Skip to content

Commit

Permalink
Add tests to confirm existing number parsing behavior (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktimsaikia committed Oct 5, 2020
1 parent 7f09a53 commit 6427722
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parse.js
Expand Up @@ -75,6 +75,11 @@ test('handle `+` correctly', t => {
t.deepEqual(queryString.parse('foo+faz=bar+baz++'), {'foo faz': 'bar baz '});
});

test('parses numbers with exponential notation as string', t => {
t.deepEqual(queryString.parse('192e11=bar'), {'192e11': 'bar'});
t.deepEqual(queryString.parse('bar=192e11'), {bar: '192e11'});
});

test('handle `+` correctly when not decoding', t => {
t.deepEqual(queryString.parse('foo+faz=bar+baz++', {decode: false}), {'foo+faz': 'bar+baz++'});
});
Expand Down

0 comments on commit 6427722

Please sign in to comment.