Skip to content

Commit fdcc78c

Browse files
committed
Add tests and update refs.
1 parent 5ba586c commit fdcc78c

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

tests/parser/type_comment1.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,18 @@
22

33
def ndarray_func(x):
44
# type: (np.ndarray) -> np.ndarray
5-
return x
5+
return x
6+
7+
@decorator1 # type: ignore
8+
9+
# Comment
10+
11+
@decorator2
12+
13+
# Comment
14+
15+
@decorator3 # type: ignore
16+
17+
def test(x):
18+
# type: (np.ndarray) -> np.ndarray
19+
return x

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": "cdc0bdd0faec912e7f3db4e71c4a14aa281828e8b68faac91f5a78ee",
5+
"infile_hash": "9c79bc041758b5401f4431a53b6b333999a4e7dfe9dfabac13d83178",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "ast_new-type_comment1-710ea6c.stdout",
9-
"stdout_hash": "98ccc7f80021238fff1a1a1395e64b5d2097f025e60e47821ec76fdb",
9+
"stdout_hash": "c7019449158ebe30677a0808ad2fd8f93aebd2eee6cd90914c44cd98",
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")] [])
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 "")])

0 commit comments

Comments
 (0)