Test: additional testing of fixed issues

Double quotation char is missing, so added it
Added a test to see if the added escaping characters work
This commit is contained in:
GreasySlug 2022-09-16 20:55:57 +09:00
parent 857742dd96
commit 0bb9ef6a85
3 changed files with 7 additions and 5 deletions

View file

@ -6,7 +6,7 @@ a, _, ...b = five_elem_tuple
f x, y =
x + y
if! True, do!:
print! "\\hello, world\""
print! "\"\\hello, world\\\""
10.times! do!:
if! x.y.z, do!:
print! ""

View file

@ -9,7 +9,7 @@
0.00, -0.0, .1, 400.
# Str Literal
"", "a", "こんにちは", "\" \\ "
"", "a", "こんにちは", "\"\\", "\"\'\\\0\r\n\t"
# Boolean Litteral
True, False

View file

@ -37,7 +37,7 @@ fn test_lexer_for_basic() -> ParseResult<()> {
(Comma, ","),
(UBar, "_"),
(Comma, ","),
(Spread, "..."), // EllipsisLit
(EllipsisLit, "..."),
(Symbol, "b"),
(Equal, "="),
(Symbol, "five_elem_tuple"),
@ -62,7 +62,7 @@ fn test_lexer_for_basic() -> ParseResult<()> {
(Newline, newline),
(Indent, " "),
(Symbol, "print!"),
(StrLit, "\"\\\\hello, world\\\"\""),
(StrLit, "\"\"\\hello, world\\\"\""),
(Newline, newline),
(NatLit, "10"),
(Dot, "."),
@ -264,7 +264,9 @@ fn test_lexer_for_literals() -> ParseResult<()> {
(Comma, ","),
(StrLit, "\"こんにちは\""),
(Comma, ","),
(StrLit, "\"\\\" \\\\ \""),
(StrLit, "\"\"\\\""),
(Comma, ","),
(StrLit, "\"\"\'\\\0\r\n \""),
(Newline, newline),
(Newline, newline),
(Newline, newline),