Skip to content

Commit dd744a4

Browse files
Add tests and update the refs.
1 parent 337fe41 commit dd744a4

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

tests/parser/string2.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"\"\\"
2+
"\n\\"
3+
"\\"
4+
" \\"
5+
"\\ "
6+
"\
7+
"
8+
"\\" "|"
9+
10+
r"""Text\\"""
11+
"""\
12+
"""
13+
x("""\
14+
class a:
15+
def test():
16+
return r"\\LaTeX"
17+
""")
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "ast_new-string2-44323ea",
3+
"cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}",
4+
"infile": "tests/parser/string2.py",
5+
"infile_hash": "fc6c3d133d5b93c5b5f052b9d86c2b1f270149aa48dba8ae8ced3e86",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": "ast_new-string2-44323ea.stdout",
9+
"stdout_hash": "cf514f21d4a57de66c5fbfc107a6ab58818a09359ef9ba651896d71f",
10+
"stderr": null,
11+
"stderr_hash": null,
12+
"returncode": 0
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(Module [(Expr (ConstantStr "\"\\" ())) (Expr (ConstantStr "
2+
\\" ())) (Expr (ConstantStr "\\" ())) (Expr (ConstantStr " \\" ())) (Expr (ConstantStr "\\ " ())) (Expr (ConstantStr "\
3+
" ())) (Expr (ConstantStr "\\|" ())) (Expr (ConstantStr "Text\\" ())) (Expr (ConstantStr "\
4+
" ())) (Expr (Call (Name x Load) [(ConstantStr "\
5+
class a:
6+
def test():
7+
return r"\\LaTeX"
8+
" ())] []))] [])

tests/tests.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,10 @@ ast_new = true
502502
filename = "parser/string1.py"
503503
ast_new = true
504504

505+
[[test]]
506+
filename = "parser/string2.py"
507+
ast_new = true
508+
505509
[[test]]
506510
filename = "parser/global1.py"
507511
ast = true

0 commit comments

Comments
 (0)