Skip to content

Commit 0df7765

Browse files
committed
Add test
1 parent 197d6ca commit 0df7765

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

tests/errors/test_literal.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_literal1():
2+
x: i32 = 0123
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "tokens-test_literal-e20c024",
3+
"cmd": "lpython --no-color --show-tokens {infile} -o {outfile}",
4+
"infile": "tests/errors/test_literal.py",
5+
"infile_hash": "ac9e219faa40c6554983087e8ac198c323f2e5af284b8689f5608f76",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "tokens-test_literal-e20c024.stderr",
11+
"stderr_hash": "58fe8b74550bd6f81761b173626f3d45eaae346665862f1b085eebe8",
12+
"returncode": 1
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
tokenizer error: Leading zeros in decimal integer are not allowed
2+
--> tests/errors/test_literal.py:2:14
3+
|
4+
2 | x: i32 = 0123
5+
| ^^^^

tests/tests.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,10 @@ tokens = true
11971197
filename = "tokens/errors/indent3.py"
11981198
tokens = true
11991199

1200+
[[test]]
1201+
filename = "errors/test_literal.py"
1202+
tokens = true
1203+
12001204
[[test]]
12011205
filename = "errors/kwargs_01_error.py"
12021206
asr = true

0 commit comments

Comments
 (0)