Skip to content

Commit 719d4ff

Browse files
committed
Unit test some more edge cases
1 parent e9e60b9 commit 719d4ff

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

crates/nu-parser/tests/test_parser_unicode_escapes.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ pub fn unicode_escapes_in_strings() {
5555
Tc(br#""\u006enu\u0075\u0073\u0073""#, "nnuuss"),
5656
Tc(br#""hello \u{6e}\u{000075}\u{073}hell""#, "hello nushell"),
5757
Tc(br#""abc""#, "abc"),
58-
Tc(br#""\u{39}8\u{10ffff}""#, "98\u{10ffff}"), // shouldn't work?
59-
//Tc(br#""#,""),
60-
//Tc(br#""#,""),
61-
//Tc(br#""#,""),
58+
Tc(br#""\u{39}8\u{10ffff}""#, "98\u{10ffff}"),
59+
Tc(br#""abc\u{41}""#, "abcA"), // at end of string
60+
Tc(br#""\u{41}abc""#, "Aabc"), // at start of string
61+
Tc(br#""\u{a}""#, "\n"), // single digit
6262
];
6363

6464
for tci in test_vec {
@@ -81,11 +81,8 @@ pub fn unicode_escapes_in_strings_expected_failures() {
8181
Tc(
8282
br#""\u{39}8\u{000000000000000000000000000000000000000000000037}""#,
8383
"any shape",
84-
), // shouldn't work?
85-
Tc(br#""\u{110000}""#, "any shape"), // max unicode <= 0x10ffff?
86-
//Tc(br#""#,""),
87-
//Tc(br#""#,""),
88-
//Tc(br#""#,""),
84+
), // hex too long, but small value
85+
Tc(br#""\u{110000}""#, "any shape"), // max unicode <= 0x10ffff
8986
];
9087

9188
for tci in test_vec {

0 commit comments

Comments
 (0)