testJSONMarshal tests both JSON marshaling and unmarshaling of a value by comparing the marshaled output with the expected JSON string. This is the recommended function for most use cases. It performs a round-trip test that ensures both marshaling (Go value to JSON) and unmarshaling (JSON to Go val
(t *testing.T, v T, want string, opts ...cmp.Option)
| 245 | // It performs a round-trip test that ensures both marshaling (Go value to JSON) |
| 246 | // and unmarshaling (JSON to Go value) work correctly and produce semantically equivalent results. |
| 247 | func testJSONMarshal[T any](t *testing.T, v T, want string, opts ...cmp.Option) { |
| 248 | t.Helper() |
| 249 | |
| 250 | testJSONMarshalOnly(t, v, want) |
| 251 | testJSONUnmarshalOnly(t, v, want, opts...) |
| 252 | } |
| 253 | |
| 254 | // testJSONMarshalOnly tests JSON marshaling by comparing the marshaled output with the expected JSON string. |
| 255 | // |
no test coverage detected
searching dependent graphs…