Skip to content

Commit

Permalink
Remove TestConformance from null_test.go. It was useful to demonstrate
Browse files Browse the repository at this point in the history
the marshaling/unmarshaling was produced the output I expected.
  • Loading branch information
pborman committed Jul 12, 2021
1 parent ae25fc6 commit e28eb7b
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions null_test.go
Expand Up @@ -7,7 +7,6 @@ package uuid
import (
"bytes"
"encoding/json"
"fmt"
"testing"
)

Expand Down Expand Up @@ -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)
}

0 comments on commit e28eb7b

Please sign in to comment.