Skip to content

Commit

Permalink
strange error explanation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxNode committed Apr 25, 2024
1 parent 56887ff commit 48f5b8c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions util/jsonutil/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ func TestMergeClonePtr(t *testing.T) {
)

err := MergeClone(imp, []byte(`{"banner":nul}`))

// json-iter will produce an error since "nul" is not a valid json value. the
// parsing code will see the "n" and then expect "ull" to follow. the strange
// "expect ull" error being asserted is generated by json-iter.
require.EqualError(t, err, "cannot unmarshal openrtb2.Imp.Banner: expect ull")
})

Expand Down Expand Up @@ -142,6 +146,10 @@ func TestMergeCloneSlice(t *testing.T) {
)

err := MergeClone(imp, []byte(`{"iframeBuster":nul}`))

// json-iter will produce an error since "nul" is not a valid json value. the
// parsing code will see the "n" and then expect "ull" to follow. the strange
// "expect ull" error being asserted is generated by json-iter.
require.EqualError(t, err, "cannot unmarshal openrtb2.Imp.IframeBuster: expect ull")
})

Expand Down Expand Up @@ -224,6 +232,10 @@ func TestMergeCloneMap(t *testing.T) {
)

err := MergeClone(test, []byte(`{"foo":nul}`))

// json-iter will produce an error since "nul" is not a valid json value. the
// parsing code will see the "n" and then expect "ull" to follow. the strange
// "expect ull" error being asserted is generated by json-iter.
require.EqualError(t, err, "cannot unmarshal Foo: expect ull")
})

Expand Down

0 comments on commit 48f5b8c

Please sign in to comment.