Skip to content

Commit

Permalink
fixup! parser: rework ReadHexNumber function
Browse files Browse the repository at this point in the history
  • Loading branch information
belochub committed Jun 23, 2017
1 parent 314c0de commit 58bb604
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/fixtures/serde-test-cases/deserialization/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ module.exports = [
name: 'Unicode code point escapes',
value: '💚💛',
serialized: '\'\\u{1F49A}\\u{1F49B}\''
},
{
name: 'hexadecimal escape sequences',
value: 'Hello',
serialized: '\'\\x48\\x65\\x6c\\x6c\\x6f\''
}
];
4 changes: 4 additions & 0 deletions test/fixtures/serde-test-cases/invalid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,9 @@ module.exports = [
{
name: 'missing value in object',
value: '{key:,}'
},
{
name: 'overflow in Unicode escape sequence',
value: '\'\\u{420420}\''
}
];
5 changes: 5 additions & 0 deletions test/fixtures/serde-test-cases/serde/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ module.exports = [
name: 'string with Unicode escape sequences',
value: '01\u0000\u0001',
serialized: '\'01\\u0000\\u0001\''
},
{
name: 'string with Unicode escape sequences followed by numbers',
value: '\u00000\u00011',
serialized: '\'\\u00000\\u00011\''
}
];

0 comments on commit 58bb604

Please sign in to comment.