Add tests for Unicode escape sequences

This commit is contained in:
Colin Benner 2018-10-04 12:14:40 +02:00
parent dc82d2db5c
commit 94e2193287

View file

@ -476,3 +476,12 @@ fn test_escapes() {
test("'ab\\'cd\\n\\t'", "1 ab'cd\n\t (ab'cd\n\t)");
test("'x\\a'", "Expected term, got <Invalid escape sequence \\a>");
}
#[test]
fn test_unicode_escape() {
test(
"\\u9999999",
"Expected term, got <Invalid unicode scalar: 9999999>",
);
test("0\\u2103", "273.15 kelvin (temperature)");
}