Skip to content

Commit

Permalink
Add tests that cover backslashes in raw strings
Browse files Browse the repository at this point in the history
The official grammar does not allow backslashes in raw strings except when followed by single quote, however there are compliance tests that require backslashes to be treated as any other character, and jp seem to work that way.
  • Loading branch information
iconara committed Aug 12, 2016
1 parent 7115be1 commit c0f7923
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/literal.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@
"comment": "Can escape the single quote",
"expression": "'foo\\'bar'",
"result": "foo'bar"
},
{
"comment": "Backslash not followed by single quote is treated as any other character",
"expression": "'\\z'",
"result": "\\z"
},
{
"comment": "Backslash not followed by single quote is treated as any other character",
"expression": "'\\\\'",
"result": "\\\\"
}
]
}
Expand Down

0 comments on commit c0f7923

Please sign in to comment.