From 9f75bb80b99f94c5c87582acb99e57c232caf01d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 16 Aug 2022 02:22:23 -0600 Subject: Run the fuzzer a bit --- decode_scan_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'decode_scan_test.go') diff --git a/decode_scan_test.go b/decode_scan_test.go index 5ad454f..1f04ead 100644 --- a/decode_scan_test.go +++ b/decode_scan_test.go @@ -105,6 +105,13 @@ func TestRuneTypeScanner(t *testing.T) { {0, 0, RuneTypeEOF, nil}, {0, 0, RuneTypeEOF, nil}, }}, + "syntax-error": {`[[0,]`, []ReadRuneTypeResult{ + {'[', 1, RuneTypeArrayBeg, nil}, + {'[', 1, RuneTypeArrayBeg, nil}, + {'0', 1, RuneTypeNumberIntZero, nil}, + {',', 1, RuneTypeArrayComma, nil}, + {']', 1, RuneTypeError, &DecodeSyntaxError{Offset: 5, Err: fmt.Errorf("invalid character %q looking for beginning of value", ']')}}, + }}, } for tcName, tc := range testcases { t.Run(tcName, func(t *testing.T) { -- cgit v1.2.3-2-g168b