-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample_test.go
More file actions
37 lines (32 loc) · 843 Bytes
/
example_test.go
File metadata and controls
37 lines (32 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package assertjson_test
import (
"fmt"
"github.com/swaggest/assertjson"
)
var t = testingT(func(format string, args ...interface{}) {
fmt.Printf(format, args...)
})
func Example() {
assertjson.Equal(t,
[]byte(`{"a": [1, {"val": "<ignore-diff>"}, 3], "b": 2, "c": 3}`),
[]byte(`{"a": [1, {"val": 123}, 3], "c": 2, "b": 3}`),
)
// Output:
// Error Trace: equal.go:82
// equal.go:57
// example_test.go:14
// Error: Not equal:
// {
// "a": [
// 1,
// {
// "val": "<ignore-diff>"
// },
// 3
// ],
// - "b": 2,
// + "b": 3,
// - "c": 3
// + "c": 2
// }
}