We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import "encoding/json" func TestJsonRawMessage(t *testing.T) { type T json.RawMessage a := T(`{"foo":1,"bar":2}`) b := T(`{"bar":2,"foo":1}`) // just informative begin aI := map[string]interface{}{} bI := map[string]interface{}{} _ = json.Unmarshal(a, &aI) _ = json.Unmarshal(b, &bI) fmt.Println(aI) fmt.Println(bI) // end diff := deep.Equal(a, b) if len(diff) != 0 { t.Fatalf("expected 0 diff, got %d: %s", len(diff), diff) } }
go test -run ^TestJsonRawMessage$ github.com/go-test/deep map[bar:2 foo:1] map[bar:2 foo:1] --- FAIL: TestJsonRawMessage (0.00s) .../deep/deep_test.go:1603: expected 0 diff, got 8: [slice[2]: 102 != 98 slice[3]: 111 != 97 slice[4]: 111 != 114 slice[7]: 49 != 50 slice[10]: 98 != 102 slice[11]: 97 != 111 slice[12]: 114 != 111 slice[15]: 50 != 49] FAIL FAIL github.com/go-test/deep 0.002s FAIL
might be tricky tho, since the actual type within there can be any json supported type
The text was updated successfully, but these errors were encountered:
No branches or pull requests
might be tricky tho, since the actual type within there can be any json supported type
The text was updated successfully, but these errors were encountered: