|
@@ -66,7 +66,16 @@ func TestPredefinedUUID(t *testing.T) {
|
|
|
}
|
|
}
|
|
|
expectedJson := `"` + testsUUID[i].input + `"`
|
|
expectedJson := `"` + testsUUID[i].input + `"`
|
|
|
if string(json) != expectedJson {
|
|
if string(json) != expectedJson {
|
|
|
- t.Errorf("MarshalJSON #%d: expected %d got %d", i, expectedJson, string(json))
|
|
|
|
|
|
|
+ t.Errorf("MarshalJSON #%d: expected %v got %v", i, expectedJson, string(json))
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var unmarshaled UUID
|
|
|
|
|
+ err = unmarshaled.UnmarshalJSON(json)
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ t.Errorf("UnmarshalJSON #%d: %v", i, err)
|
|
|
|
|
+ }
|
|
|
|
|
+ if unmarshaled != uuid {
|
|
|
|
|
+ t.Errorf("UnmarshalJSON #%d: expected %v got %v", i, uuid, unmarshaled)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|