mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-04 22:40:17 +00:00
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:
parent
857742dd96
commit
0bb9ef6a85
3 changed files with 7 additions and 5 deletions
|
@ -6,7 +6,7 @@ a, _, ...b = five_elem_tuple
|
||||||
f x, y =
|
f x, y =
|
||||||
x + y
|
x + y
|
||||||
if! True, do!:
|
if! True, do!:
|
||||||
print! "\\hello, world\""
|
print! "\"\\hello, world\\\""
|
||||||
10.times! do!:
|
10.times! do!:
|
||||||
if! x.y.z, do!:
|
if! x.y.z, do!:
|
||||||
print! ""
|
print! ""
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
0.00, -0.0, .1, 400.
|
0.00, -0.0, .1, 400.
|
||||||
|
|
||||||
# Str Literal
|
# Str Literal
|
||||||
"", "a", "こんにちは", "\" \\ "
|
"", "a", "こんにちは", "\"\\", "\"\'\\\0\r\n\t"
|
||||||
|
|
||||||
# Boolean Litteral
|
# Boolean Litteral
|
||||||
True, False
|
True, False
|
||||||
|
|
|
@ -37,7 +37,7 @@ fn test_lexer_for_basic() -> ParseResult<()> {
|
||||||
(Comma, ","),
|
(Comma, ","),
|
||||||
(UBar, "_"),
|
(UBar, "_"),
|
||||||
(Comma, ","),
|
(Comma, ","),
|
||||||
(Spread, "..."), // EllipsisLit
|
(EllipsisLit, "..."),
|
||||||
(Symbol, "b"),
|
(Symbol, "b"),
|
||||||
(Equal, "="),
|
(Equal, "="),
|
||||||
(Symbol, "five_elem_tuple"),
|
(Symbol, "five_elem_tuple"),
|
||||||
|
@ -62,7 +62,7 @@ fn test_lexer_for_basic() -> ParseResult<()> {
|
||||||
(Newline, newline),
|
(Newline, newline),
|
||||||
(Indent, " "),
|
(Indent, " "),
|
||||||
(Symbol, "print!"),
|
(Symbol, "print!"),
|
||||||
(StrLit, "\"\\\\hello, world\\\"\""),
|
(StrLit, "\"\"\\hello, world\\\"\""),
|
||||||
(Newline, newline),
|
(Newline, newline),
|
||||||
(NatLit, "10"),
|
(NatLit, "10"),
|
||||||
(Dot, "."),
|
(Dot, "."),
|
||||||
|
@ -264,7 +264,9 @@ fn test_lexer_for_literals() -> ParseResult<()> {
|
||||||
(Comma, ","),
|
(Comma, ","),
|
||||||
(StrLit, "\"こんにちは\""),
|
(StrLit, "\"こんにちは\""),
|
||||||
(Comma, ","),
|
(Comma, ","),
|
||||||
(StrLit, "\"\\\" \\\\ \""),
|
(StrLit, "\"\"\\\""),
|
||||||
|
(Comma, ","),
|
||||||
|
(StrLit, "\"\"\'\\\0\r\n \""),
|
||||||
(Newline, newline),
|
(Newline, newline),
|
||||||
(Newline, newline),
|
(Newline, newline),
|
||||||
(Newline, newline),
|
(Newline, newline),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue