Skip to content

Commit 720023d

Browse files
Add tests and update the refs.
1 parent c382f48 commit 720023d

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

tests/parser/string1.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,27 @@
4747
RB"Text"
4848

4949
rf'\N{AMPERSAND}'
50+
51+
(f"Text{a}, {b}"
52+
f"Text {a}")
53+
54+
(f"Text{a}, {b}"
55+
"Text")
56+
57+
("Text"
58+
f"{b}, Text")
59+
60+
(f"Text {a}"
61+
r"Text")
62+
63+
(r"Text"
64+
r"Text")
65+
66+
(r"Text"
67+
"Text")
68+
69+
(r"Text"
70+
f"{a} Text")
71+
72+
(b"Text"
73+
b"Text")

tests/reference/ast_new-string1-96b90b3.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "ast_new-string1-96b90b3",
33
"cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}",
44
"infile": "tests/parser/string1.py",
5-
"infile_hash": "e4090ab45efb09242e14f3dd494ca869a32e71de3617306d959d8721",
5+
"infile_hash": "fd64c289d2ab5638fcc3093bda8f07fdde0e034798d4c04791fd441b",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "ast_new-string1-96b90b3.stdout",
9-
"stdout_hash": "1666ca8ebba593a8bf35e7906efabf5726626b7c82b130324bd78a43",
9+
"stdout_hash": "e23911e24aada1bf320ffde6cca77cc2a19700d09a2e9b01bbd37afa",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/ast_new-string1-96b90b3.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ anotherline
55
Text
66
" ())) (Expr (ConstantStr "Text" ())) (Expr (ConstantStr "a\tb\nA\tB" ())) (Expr (ConstantStr "1,2,3 # comment" "u")) (Expr (ConstantStr "Text" "u")) (Expr (ConstantStr "Text" ())) (Expr (JoinedStr [(ConstantStr "Text " ()) (FormattedValue (Name id Load) -1 ())])) (Expr (JoinedStr [(ConstantStr "Text " ()) (FormattedValue (Name id Load) -1 ())])) (Expr (JoinedStr [(ConstantStr "Text " ()) (FormattedValue (Name id Load) -1 ())])) (Expr (JoinedStr [(ConstantStr "Text " ()) (FormattedValue (Name id Load) -1 ())])) (Expr (JoinedStr [(ConstantStr "Text " ()) (FormattedValue (Name id Load) -1 ())])) (Expr (JoinedStr [(ConstantStr "
77
Text " ()) (FormattedValue (Name id Load) -1 ()) (ConstantStr "
8-
" ())])) (Expr (JoinedStr [(ConstantStr "Text " ()) (FormattedValue (Name id Load) -1 ())])) (Expr (JoinedStr [(ConstantStr "Text " ()) (FormattedValue (Name id Load) -1 ())])) (Expr (ConstantBytes "b'Text'" ())) (Expr (ConstantBytes "b'\nText\n'" ())) (Expr (ConstantBytes "b'Text'" ())) (Expr (ConstantBytes "b'Text'" ())) (Expr (ConstantBytes "b'Text'" ())) (Expr (ConstantBytes "b'\nText\n'" ())) (Expr (ConstantBytes "b'Text'" ())) (Expr (ConstantBytes "b'Text'" ())) (Expr (JoinedStr [(ConstantStr "\N" ()) (FormattedValue (Name AMPERSAND Load) -1 ())]))] [])
8+
" ())])) (Expr (JoinedStr [(ConstantStr "Text " ()) (FormattedValue (Name id Load) -1 ())])) (Expr (JoinedStr [(ConstantStr "Text " ()) (FormattedValue (Name id Load) -1 ())])) (Expr (ConstantBytes "b'Text'" ())) (Expr (ConstantBytes "b'\nText\n'" ())) (Expr (ConstantBytes "b'Text'" ())) (Expr (ConstantBytes "b'Text'" ())) (Expr (ConstantBytes "b'Text'" ())) (Expr (ConstantBytes "b'\nText\n'" ())) (Expr (ConstantBytes "b'Text'" ())) (Expr (ConstantBytes "b'Text'" ())) (Expr (JoinedStr [(ConstantStr "\N" ()) (FormattedValue (Name AMPERSAND Load) -1 ())])) (Expr (JoinedStr [(ConstantStr "Text" ()) (FormattedValue (Name a Load) -1 ()) (ConstantStr ", " ()) (FormattedValue (Name b Load) -1 ()) (ConstantStr "Text " ()) (FormattedValue (Name a Load) -1 ())])) (Expr (JoinedStr [(ConstantStr "Text" ()) (FormattedValue (Name a Load) -1 ()) (ConstantStr ", " ()) (FormattedValue (Name b Load) -1 ()) (ConstantStr "Text" ())])) (Expr (JoinedStr [(ConstantStr "Text" ()) (FormattedValue (Name b Load) -1 ()) (ConstantStr ", Text" ())])) (Expr (JoinedStr [(ConstantStr "Text " ()) (FormattedValue (Name a Load) -1 ()) (ConstantStr "Text" ())])) (Expr (ConstantStr "TextText" ())) (Expr (ConstantStr "TextText" ())) (Expr (JoinedStr [(ConstantStr "Text" ()) (FormattedValue (Name a Load) -1 ()) (ConstantStr " Text" ())])) (Expr (ConstantBytes "b'TextText'" ()))] [])

0 commit comments

Comments
 (0)