We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bedaaff commit ec45224Copy full SHA for ec45224
bson/decode_value_fuzz_test.go
@@ -27,6 +27,10 @@ func FuzzDecodeValue(f *testing.F) {
27
int64(0), math.MaxInt64, math.MinInt64,
28
// string, including empty and large string.
29
"", strings.Repeat("z", 10_000),
30
+ // map
31
+ map[string]any{"nested": []any{1, "two", map[string]any{"three": 3}}},
32
+ // array
33
+ []any{1, 2, 3, "four"},
34
}
35
36
for _, v := range values {
@@ -48,6 +52,7 @@ func FuzzDecodeValue(f *testing.F) {
48
52
// to "nil". It's not clear if MarshalValue should support "nil", but
49
53
// for now we skip it.
50
54
if v == nil {
55
+ t.Logf("data unmarshaled to nil: %v", data)
51
56
return
57
58
@@ -56,7 +61,8 @@ func FuzzDecodeValue(f *testing.F) {
61
t.Fatalf("failed to marshal: %v", err)
62
63
59
- if err := UnmarshalValue(typ, encoded, &v); err != nil {
64
+ var v2 any
65
+ if err := UnmarshalValue(typ, encoded, &v2); err != nil {
60
66
t.Fatalf("failed to unmarshal: %v", err)
67
68
})
0 commit comments