Skip to content

Commit

Permalink
test(raw): improve raw decode test
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Nov 5, 2021
1 parent 3a468c1 commit 9280e64
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion dec_raw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ func TestDecoder_Raw(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, Array, raw.Type())
assert.Equal(t, `[1, 2, 3, 4, 5]`, raw.String())
t.Logf("%q", raw)
var rd Decoder
rd.ResetBytes(raw)
assert.NoError(t, rd.Arr(func(d *Decoder) error {
raw, err := d.Raw()
assert.NoError(t, err)
assert.Equal(t, Number, raw.Type())
n, err := DecodeBytes(raw).Num()
assert.NoError(t, err)
assert.False(t, n.Str())
return nil
}))
return err
}))
})
Expand Down

0 comments on commit 9280e64

Please sign in to comment.