mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-03 05:54:33 +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 =
|
||||
x + y
|
||||
if! True, do!:
|
||||
print! "\\hello, world\""
|
||||
print! "\"\\hello, world\\\""
|
||||
10.times! do!:
|
||||
if! x.y.z, do!:
|
||||
print! ""
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
0.00, -0.0, .1, 400.
|
||||
|
||||
# Str Literal
|
||||
"", "a", "こんにちは", "\" \\ "
|
||||
"", "a", "こんにちは", "\"\\", "\"\'\\\0\r\n\t"
|
||||
|
||||
# Boolean Litteral
|
||||
True, False
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue