Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JPercival committed Dec 13, 2024
1 parent 78c494c commit b196833
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ object StringEscapeUtils {
append(
// Use the mapped escape sequence or
// default to Unicode for non-printable characters
// '\u0020'..'\u007E' are printable ASCII characters
ESCAPE_MAP[char]
?: if (char.isISOControl() || char !in '\u0020'..'\u007E') {
"\\u%04x".format(char.code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ void escape() {
assertEquals("Hello \\'World\\'2", escapeCql("Hello 'World'2"));
assertEquals("Hello \\\"World\\\"2", escapeCql("Hello \"World\"2"));
assertEquals("\\f\\n\\r\\t\\/\\\\", escapeCql("\f\n\r\t/\\"));
assertEquals("\\u110f", escapeCql("ᄏ")); // unprintable character
assertEquals(
"This is an identifier with \\\"multiple\\\" embedded \\t escapes\u0020\\r\\nno really, \\r\\n\\f\\t\\/\\\\lots of them",
escapeCql(
Expand Down

0 comments on commit b196833

Please sign in to comment.