Skip to content

Commit 251818e

Browse files
committed
TEST: Update reference tests
1 parent 9139b25 commit 251818e

18 files changed

+207
-805
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "asr-array_size_01-1d39bb5",
3+
"cmd": "lpython --show-asr --indent --no-color {infile} -o {outfile}",
4+
"infile": "tests/errors/array_size_01.py",
5+
"infile_hash": "2048f745528343089a5c4c86917af2f6216b32fde07973c8497d0a94",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "asr-array_size_01-1d39bb5.stderr",
11+
"stderr_hash": "ff1f57a762db4562936cc84fab44bebe44c6e54720cf9fa2dc0424af",
12+
"returncode": 2
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
semantic error: Function 'size' is not declared and not intrinsic
2+
--> tests/errors/array_size_01.py:6:11
3+
|
4+
6 | print(size(x))
5+
| ^^^^^^^

tests/reference/asr-doconcurrentloop_01-7b9a7d3.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"infile_hash": "2fe3769863a595a01e46a88bf55c944e61a0d141d5c75816ffa74d96",
66
"outfile": null,
77
"outfile_hash": null,
8-
"stdout": "asr-doconcurrentloop_01-7b9a7d3.stdout",
9-
"stdout_hash": "dffb1f7233f48b1711345ac6d1649bfdc6d8244f5596e9a2a9144904",
10-
"stderr": null,
11-
"stderr_hash": null,
12-
"returncode": 0
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "asr-doconcurrentloop_01-7b9a7d3.stderr",
11+
"stderr_hash": "7fa9913490187ed716a0fd84a2bd1e191f61992e66031acb3dc9cb89",
12+
"returncode": 2
1313
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
semantic error: Function 'size' is not declared and not intrinsic
2+
--> tests/doconcurrentloop_01.py:6:9
3+
|
4+
6 | N = size(a)
5+
| ^^^^^^^

tests/reference/asr-doconcurrentloop_01-7b9a7d3.stdout

Lines changed: 0 additions & 492 deletions
This file was deleted.

tests/reference/asr-set1-7de4081.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"infile_hash": "63b5dc6a1f9c17099f1b10c8c45fcac1e50319ca8efbf7c283060abb",
66
"outfile": null,
77
"outfile_hash": null,
8-
"stdout": "asr-set1-7de4081.stdout",
9-
"stdout_hash": "9d61d7c399bc81558e15e3ced4f525fedb099643562fc308ae43f74b",
10-
"stderr": null,
11-
"stderr_hash": null,
12-
"returncode": 0
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "asr-set1-7de4081.stderr",
11+
"stderr_hash": "59d4e681f8928465c31631eda2d86dce8e80e457c1fa5fa5ba775485",
12+
"returncode": 1
1313
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Internal Compiler Error: Unhandled exception
2+
Traceback (most recent call last):
3+
 File "$DIR/src/bin/lpython.cpp", line 1700
4+
return emit_asr(arg_file, lpython_pass_manager, runtime_library_dir,
5+
 File "$DIR/src/bin/lpython.cpp", line 194
6+
r = LCompilers::LPython::python_ast_to_asr(al, lm, *ast, diagnostics,
7+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 6956
8+
auto res2 = body_visitor(al, lm, *ast_m, diagnostics, unit, main_module,
9+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 6909
10+
b.visit_Module(ast);
11+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4162
12+
visit_stmt(*x.m_body[i]);
13+
 File "$DIR/src/lpython/python_ast.h", line 1883
14+
void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
15+
 File "$DIR/src/lpython/python_ast.h", line 1751
16+
case stmtType::FunctionDef: { v.visit_FunctionDef((const FunctionDef_t &)x); return; }
17+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4271
18+
handle_fn(x, *f);
19+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4251
20+
transform_stmts(body, x.n_body, x.m_body);
21+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4122
22+
this->visit_stmt(*m_body[i]);
23+
 File "$DIR/src/lpython/python_ast.h", line 1883
24+
void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
25+
 File "$DIR/src/lpython/python_ast.h", line 1772
26+
case stmtType::Nonlocal: { v.visit_Nonlocal((const Nonlocal_t &)x); return; }
27+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 5878
28+
handle_attribute(te, at->m_attr, x.base.base.loc, elements);
29+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 663
30+
tmp = attr_handler.get_attribute(s, attr_name, al, loc, args, diag);
31+
 File "$DIR/src/lpython/semantics/python_attribute_eval.h", line 57
32+
std::string class_name = get_type_name(type);
33+
 File "$DIR/src/lpython/semantics/python_attribute_eval.h", line 40
34+
if (ASRUtils::is_array(t)) {
35+
 File "../libasr/asr_utils.h", line 1730
36+
 File "../libasr/asr_utils.h", line 1619
37+
LCompilersException: Not implemented 6.

tests/reference/asr-set1-7de4081.stdout

Lines changed: 0 additions & 172 deletions
This file was deleted.

tests/reference/asr-test_set1-8fde53c.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"stdout": null,
99
"stdout_hash": null,
1010
"stderr": "asr-test_set1-8fde53c.stderr",
11-
"stderr_hash": "9dcd4fd9b8878cabe6559827531844364da8311d7c8f5f846b38620d",
12-
"returncode": 2
11+
"stderr_hash": "59d4e681f8928465c31631eda2d86dce8e80e457c1fa5fa5ba775485",
12+
"returncode": 1
1313
}
Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
1-
semantic error: Type mismatch in 'add', the types must be compatible
2-
--> tests/errors/test_set1.py:6:11
3-
|
4-
6 | a.add('err')
5-
| ^^^^^ type mismatch (found: 'str', expected: 'i32')
1+
Internal Compiler Error: Unhandled exception
2+
Traceback (most recent call last):
3+
 File "$DIR/src/bin/lpython.cpp", line 1700
4+
return emit_asr(arg_file, lpython_pass_manager, runtime_library_dir,
5+
 File "$DIR/src/bin/lpython.cpp", line 194
6+
r = LCompilers::LPython::python_ast_to_asr(al, lm, *ast, diagnostics,
7+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 6956
8+
auto res2 = body_visitor(al, lm, *ast_m, diagnostics, unit, main_module,
9+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 6909
10+
b.visit_Module(ast);
11+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4162
12+
visit_stmt(*x.m_body[i]);
13+
 File "$DIR/src/lpython/python_ast.h", line 1883
14+
void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
15+
 File "$DIR/src/lpython/python_ast.h", line 1751
16+
case stmtType::FunctionDef: { v.visit_FunctionDef((const FunctionDef_t &)x); return; }
17+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4271
18+
handle_fn(x, *f);
19+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4251
20+
transform_stmts(body, x.n_body, x.m_body);
21+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4122
22+
this->visit_stmt(*m_body[i]);
23+
 File "$DIR/src/lpython/python_ast.h", line 1883
24+
void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
25+
 File "$DIR/src/lpython/python_ast.h", line 1772
26+
case stmtType::Nonlocal: { v.visit_Nonlocal((const Nonlocal_t &)x); return; }
27+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 5878
28+
handle_attribute(te, at->m_attr, x.base.base.loc, elements);
29+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 663
30+
tmp = attr_handler.get_attribute(s, attr_name, al, loc, args, diag);
31+
 File "$DIR/src/lpython/semantics/python_attribute_eval.h", line 57
32+
std::string class_name = get_type_name(type);
33+
 File "$DIR/src/lpython/semantics/python_attribute_eval.h", line 40
34+
if (ASRUtils::is_array(t)) {
35+
 File "../libasr/asr_utils.h", line 1730
36+
 File "../libasr/asr_utils.h", line 1619
37+
LCompilersException: Not implemented 6.

tests/reference/asr-test_set2-1ded45b.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"stdout": null,
99
"stdout_hash": null,
1010
"stderr": "asr-test_set2-1ded45b.stderr",
11-
"stderr_hash": "5459ddb5148c630f9374c827aad9c37d25967248002dc0dff5314530",
12-
"returncode": 2
11+
"stderr_hash": "59d4e681f8928465c31631eda2d86dce8e80e457c1fa5fa5ba775485",
12+
"returncode": 1
1313
}
Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
1-
semantic error: remove() takes exactly one argument
2-
--> tests/errors/test_set2.py:6:5
3-
|
4-
6 | a.remove('error', 'error2')
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1+
Internal Compiler Error: Unhandled exception
2+
Traceback (most recent call last):
3+
 File "$DIR/src/bin/lpython.cpp", line 1700
4+
return emit_asr(arg_file, lpython_pass_manager, runtime_library_dir,
5+
 File "$DIR/src/bin/lpython.cpp", line 194
6+
r = LCompilers::LPython::python_ast_to_asr(al, lm, *ast, diagnostics,
7+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 6956
8+
auto res2 = body_visitor(al, lm, *ast_m, diagnostics, unit, main_module,
9+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 6909
10+
b.visit_Module(ast);
11+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4162
12+
visit_stmt(*x.m_body[i]);
13+
 File "$DIR/src/lpython/python_ast.h", line 1883
14+
void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
15+
 File "$DIR/src/lpython/python_ast.h", line 1751
16+
case stmtType::FunctionDef: { v.visit_FunctionDef((const FunctionDef_t &)x); return; }
17+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4271
18+
handle_fn(x, *f);
19+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4251
20+
transform_stmts(body, x.n_body, x.m_body);
21+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 4122
22+
this->visit_stmt(*m_body[i]);
23+
 File "$DIR/src/lpython/python_ast.h", line 1883
24+
void visit_stmt(const stmt_t &b) { visit_stmt_t(b, self()); }
25+
 File "$DIR/src/lpython/python_ast.h", line 1772
26+
case stmtType::Nonlocal: { v.visit_Nonlocal((const Nonlocal_t &)x); return; }
27+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 5878
28+
handle_attribute(te, at->m_attr, x.base.base.loc, elements);
29+
 File "$DIR/src/lpython/semantics/python_ast_to_asr.cpp", line 663
30+
tmp = attr_handler.get_attribute(s, attr_name, al, loc, args, diag);
31+
 File "$DIR/src/lpython/semantics/python_attribute_eval.h", line 57
32+
std::string class_name = get_type_name(type);
33+
 File "$DIR/src/lpython/semantics/python_attribute_eval.h", line 40
34+
if (ASRUtils::is_array(t)) {
35+
 File "../libasr/asr_utils.h", line 1730
36+
 File "../libasr/asr_utils.h", line 1619
37+
LCompilersException: Not implemented 6.

tests/reference/asr-test_set3-bbd0ed1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"stdout": null,
99
"stdout_hash": null,
1010
"stderr": "asr-test_set3-bbd0ed1.stderr",
11-
"stderr_hash": "1ec6cfef0827e97a905c5927de43b74452777394b1f5110e94e5cf97",
12-
"returncode": 2
11+
"stderr_hash": "04517a807da793880cada1e8a77c520aebf0bd2ce4cc82ff50510694",
12+
"returncode": 1
1313
}

0 commit comments

Comments
 (0)