(t *testing.T)
| 199 | } |
| 200 | |
| 201 | func TestNullUUIDUnmarshalJSON(t *testing.T) { |
| 202 | jsonNull, _ := json.Marshal(nil) |
| 203 | jsonUUID, _ := json.Marshal(MustParse("12345678-abcd-1234-abcd-0123456789ab")) |
| 204 | |
| 205 | var nu NullUUID |
| 206 | err := json.Unmarshal(jsonNull, &nu) |
| 207 | if err != nil || nu.Valid { |
| 208 | t.Errorf("expected nil when unmarshalling null, got %s", err) |
| 209 | } |
| 210 | err = json.Unmarshal(jsonUUID, &nu) |
| 211 | if err != nil || !nu.Valid { |
| 212 | t.Errorf("expected nil when unmarshalling null, got %s", err) |
| 213 | } |
| 214 | } |
nothing calls this directly
no test coverage detected