diff --git a/compiler/erg_parser/tests/multi_line_str_literal.er b/compiler/erg_parser/tests/multi_line_str_literal.er index 9bf560d2..e6ff96c9 100644 --- a/compiler/erg_parser/tests/multi_line_str_literal.er +++ b/compiler/erg_parser/tests/multi_line_str_literal.er @@ -26,4 +26,15 @@ complex_string = """\\\ \t\0\ \r\n\ \\""" -print! complex_string \ No newline at end of file +print! complex_string + +quotation_mark = """\"\"\"""" +print! quotation_mark + +quotation_marks = """" +"" +""\" +\"\"\""" +\"\"" +\"\"\"""" +print! quotation_marks \ No newline at end of file diff --git a/compiler/erg_parser/tests/tokenize_test.rs b/compiler/erg_parser/tests/tokenize_test.rs index 70a56079..c87f51ac 100644 --- a/compiler/erg_parser/tests/tokenize_test.rs +++ b/compiler/erg_parser/tests/tokenize_test.rs @@ -367,6 +367,30 @@ line break\"\"\"", (Newline, newline), (Symbol, "print!"), (Symbol, "complex_string"), + (Newline, newline), + (Newline, newline), + (Symbol, "quotation_mark"), + (Equal, "="), + (StrLit, "\"\"\"\"\"\"\"\"\""), + (Newline, newline), + (Symbol, "print!"), + (Symbol, "quotation_mark"), + (Newline, newline), + (Newline, newline), + (Symbol, "quotation_marks"), + (Equal, "="), + ( + StrLit, + "\"\"\"\" +\"\" +\"\"\" +\"\"\"\"\" +\"\"\" +\"\"\"\"\"\"", + ), + (Newline, newline), + (Symbol, "print!"), + (Symbol, "quotation_marks"), (EOF, ""), ]; let mut tok: Token;