From cfc6d2d5b9ed9656165670e6ec262841aade3660 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Wed, 1 Apr 2026 15:46:23 +0200 Subject: jsonmatch: add Irrelevant --- jsonmatch/diff_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'jsonmatch/diff_test.go') diff --git a/jsonmatch/diff_test.go b/jsonmatch/diff_test.go index a59d304..74a976f 100644 --- a/jsonmatch/diff_test.go +++ b/jsonmatch/diff_test.go @@ -61,11 +61,13 @@ func TestCanonicalizesActualPayload(t *testing.T) { } AssertEqual(t, match.DiffAgainst(message), nil) - // changing the type of `data` to map[string]any does not change anything at all; - // using the jsonmatch.Object name on this level is mostly syntactic sugar to communicate intent + // changing the type of `data` to map[string]any and of `data.qux` to []any does not change anything at all; + // using the jsonmatch.Object and jsonmatch.Array names on this level is mostly syntactic sugar to communicate intent; + // + // also, this tests that jsonmatch.Irrelevant() works as expected match = jsonmatch.Object{ "data": map[string]any{ - "foo": 42, + "foo": jsonmatch.Irrelevant(), "bar": "hello world", "qux": []any{5, nil, 15}, }, -- cgit v1.2.3