(t *testing.T)
| 13 | var testUUID = MustParse("f47ac10b-58cc-0372-8567-0e02b2c3d479") |
| 14 | |
| 15 | func TestJSON(t *testing.T) { |
| 16 | type S struct { |
| 17 | ID1 UUID |
| 18 | ID2 UUID |
| 19 | } |
| 20 | s1 := S{ID1: testUUID} |
| 21 | data, err := json.Marshal(&s1) |
| 22 | if err != nil { |
| 23 | t.Fatal(err) |
| 24 | } |
| 25 | var s2 S |
| 26 | if err := json.Unmarshal(data, &s2); err != nil { |
| 27 | t.Fatal(err) |
| 28 | } |
| 29 | if !reflect.DeepEqual(&s1, &s2) { |
| 30 | t.Errorf("got %#v, want %#v", s2, s1) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | func TestJSONUnmarshal(t *testing.T) { |
| 35 | type S struct { |
nothing calls this directly
no outgoing calls
no test coverage detected