Skip to content

Commit 27f419a

Browse files
Add tests and update the refs.
1 parent 727dad3 commit 27f419a

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

tests/parser/type_comment1.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,18 @@ def ndarray_func(x):
1717
def test(x):
1818
# type: (np.ndarray) -> np.ndarray
1919
return x
20+
21+
def test(): # type: ignore
22+
# Comment
23+
...
24+
25+
def main():
26+
27+
# type: ignore
28+
pass
29+
30+
x (x, # type: ignore
31+
y)
32+
33+
from sympy.simplify import (collect, powsimp, # type: ignore
34+
separatevars, simplify)

tests/reference/ast_new-type_comment1-710ea6c.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "ast_new-type_comment1-710ea6c",
33
"cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}",
44
"infile": "tests/parser/type_comment1.py",
5-
"infile_hash": "9c79bc041758b5401f4431a53b6b333999a4e7dfe9dfabac13d83178",
5+
"infile_hash": "c4c669232bd7137cb068b0d6aaa9f4a998a0d6244b4da03ce174ea10",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "ast_new-type_comment1-710ea6c.stdout",
9-
"stdout_hash": "c7019449158ebe30677a0808ad2fd8f93aebd2eee6cd90914c44cd98",
9+
"stdout_hash": "9e22c0795da6142ec862c25e6b57dd3446f11cb35082caf318ba8f2c",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(Module [(Import [(pytest ())]) (FunctionDef ndarray_func ([] [(x () ())] [] [] [] [] []) [(Return (Name x Load))] [] () "(np.ndarray) -> np.ndarray") (FunctionDef test ([] [(x () ())] [] [] [] [] []) [(Return (Name x Load))] [(Name decorator1 Load) (Name decorator2 Load) (Name decorator3 Load)] () "(np.ndarray) -> np.ndarray")] [(TypeIgnore 0 "") (TypeIgnore 0 "") (TypeIgnore 0 "")])
1+
(Module [(Import [(pytest ())]) (FunctionDef ndarray_func ([] [(x () ())] [] [] [] [] []) [(Return (Name x Load))] [] () "(np.ndarray) -> np.ndarray") (FunctionDef test ([] [(x () ())] [] [] [] [] []) [(Return (Name x Load))] [(Name decorator1 Load) (Name decorator2 Load) (Name decorator3 Load)] () "(np.ndarray) -> np.ndarray") (FunctionDef test ([] [] [] [] [] [] []) [(Expr (ConstantEllipsis ()))] [] () ()) (FunctionDef main ([] [] [] [] [] [] []) [(Pass)] [] () ()) (Expr (Call (Name x Load) [(Name x Load) (Name y Load)] [])) (ImportFrom sympy.simplify [(collect ()) (powsimp ()) (separatevars ()) (simplify ())] 0)] [(TypeIgnore 0 "") (TypeIgnore 0 "") (TypeIgnore 0 "") (TypeIgnore 0 "") (TypeIgnore 0 "") (TypeIgnore 0 "") (TypeIgnore 0 "")])

0 commit comments

Comments
 (0)