Skip to content

Commit

Permalink
introduce some tests for malformed array indexes in GetString()
Browse files Browse the repository at this point in the history
  • Loading branch information
d-hat committed Dec 23, 2020
1 parent 9b2f299 commit d15cedb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,18 @@ var getStringTests = []GetTest{
path: []string{"c"},
isErr: true,
},
{
desc: `empty array index`,
json: `[""]`,
path: []string{"[]"},
isFound: false,
},
{
desc: `malformed array index`,
json: `[""]`,
path: []string{"["},
isFound: false,
},
}

var getUnsafeStringTests = []GetTest{
Expand Down

0 comments on commit d15cedb

Please sign in to comment.