mirror of
https://github.com/google/uuid.git
synced 2025-09-16 09:16:30 +02:00
Remove TestConformance from null_test.go. It was useful to demonstrate
the marshaling/unmarshaling was produced the output I expected.
This commit is contained in:
24
null_test.go
24
null_test.go
@@ -7,7 +7,6 @@ package uuid
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -213,26 +212,3 @@ func TestNullUUIDUnmarshalJSON(t *testing.T) {
|
||||
t.Errorf("expected nil when unmarshaling null, got %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConformance(t *testing.T) {
|
||||
input := []byte(`"12345678-abcd-1234-abcd-0123456789ab"`)
|
||||
var n NullUUID
|
||||
var u UUID
|
||||
|
||||
err := json.Unmarshal(input, &n)
|
||||
fmt.Printf("Unmarshal NullUUID: %+v %v\n", n, err)
|
||||
err = json.Unmarshal(input, &u)
|
||||
fmt.Printf("Unmarshal UUID: %+v %v\n", u, err)
|
||||
|
||||
n = NullUUID{}
|
||||
data, err := json.Marshal(&n)
|
||||
fmt.Printf("Marshal Empty NullUUID %s %v\n", data, err)
|
||||
|
||||
n.Valid = true
|
||||
n.UUID = u
|
||||
data, err = json.Marshal(&n)
|
||||
fmt.Printf("Marshal Filled NullUUID %s %v\n", data, err)
|
||||
|
||||
data, err = json.Marshal(&u)
|
||||
fmt.Printf("Marshal UUID: %s %v\n", data, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user