Skip to content

Commit 3894aa2

Browse files
committed
TEST: Updated tests
1 parent 0cc0669 commit 3894aa2

33 files changed

+183
-251
lines changed

tests/reference/asr-print_02-afbe092.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-print_02-afbe092.stdout",
9-
"stdout_hash": "81b28e9c321e4c2f5c4979702be9155fdb7a0bbe0044b34470a55926",
9+
"stdout_hash": "fc8a85b6bc8901fcbbd9bccf807cf6927c9cb26760942c2db6c55491",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-print_02-afbe092.stdout

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,7 +3037,9 @@
30373037
)]
30383038
(Tuple
30393039
[(Integer 4)
3040-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)]
3040+
(Allocatable
3041+
(String 1 () DeferredLength DescriptorString)
3042+
)]
30413043
)
30423044
)
30433045
(TupleConstant
@@ -3048,13 +3050,17 @@
30483050
)]
30493051
(Tuple
30503052
[(Integer 4)
3051-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)]
3053+
(Allocatable
3054+
(String 1 () DeferredLength DescriptorString)
3055+
)]
30523056
)
30533057
)]
30543058
(List
30553059
(Tuple
30563060
[(Integer 4)
3057-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)]
3061+
(Allocatable
3062+
(String 1 () DeferredLength DescriptorString)
3063+
)]
30583064
)
30593065
)
30603066
)
@@ -3067,7 +3073,9 @@
30673073
)]
30683074
(Tuple
30693075
[(Integer 4)
3070-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)]
3076+
(Allocatable
3077+
(String 1 () DeferredLength DescriptorString)
3078+
)]
30713079
)
30723080
)
30733081
(TupleConstant
@@ -3078,21 +3086,27 @@
30783086
)]
30793087
(Tuple
30803088
[(Integer 4)
3081-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)]
3089+
(Allocatable
3090+
(String 1 () DeferredLength DescriptorString)
3091+
)]
30823092
)
30833093
)]
30843094
(List
30853095
(Tuple
30863096
[(Integer 4)
3087-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)]
3097+
(Allocatable
3098+
(String 1 () DeferredLength DescriptorString)
3099+
)]
30883100
)
30893101
)
30903102
)]
30913103
(List
30923104
(List
30933105
(Tuple
30943106
[(Integer 4)
3095-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)]
3107+
(Allocatable
3108+
(String 1 () DeferredLength DescriptorString)
3109+
)]
30963110
)
30973111
)
30983112
)

tests/reference/asr-structs_09-f3ffe08.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-structs_09-f3ffe08.stderr",
11-
"stderr_hash": "14119a0bc6420ad242b99395d457f2092014d96d2a1ac81d376c649d",
12-
"returncode": 2
11+
"stderr_hash": "b37b8fa37881df2189147ce1d10d155f0d770374a0ebd9a9cbf312a8",
12+
"returncode": 1
1313
}
Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
semantic error: Method not found in the class StringIO or it's parents
2-
--> tests/errors/structs_09.py:13:23
3-
|
4-
13 | bytes_read: i32 = fd.read()
5-
| ^^^^^^^^^
1+
Internal Compiler Error: Unhandled exception
2+
Traceback (most recent call last):
3+
 File "$DIR/lpython.cpp", line 2142
4+
 File "$DIR/lpython.cpp", line 216
5+
 File "$DIR/semantics/python_ast_to_asr.cpp", line 9188
6+
 File "$DIR/semantics/python_ast_to_asr.cpp", line 9120
7+
 File "$DIR/semantics/python_ast_to_asr.cpp", line 5204
8+
 File "$DIR/python_ast.h", line 1909
9+
 File "$DIR/python_ast.h", line 1776
10+
 File "$DIR/semantics/python_ast_to_asr.cpp", line 5394
11+
 File "$DIR/semantics/python_ast_to_asr.cpp", line 5370
12+
 File "$DIR/semantics/python_ast_to_asr.cpp", line 5158
13+
 File "$DIR/python_ast.h", line 1909
14+
 File "$DIR/python_ast.h", line 1782
15+
 File "$DIR/semantics/python_ast_to_asr.cpp", line 5466
16+
 File "$DIR/semantics/python_ast_to_asr.cpp", line 2898
17+
 File "$DIR/python_ast.h", line 1936
18+
 File "$DIR/python_ast.h", line 1825
19+
 File "$DIR/semantics/python_ast_to_asr.cpp", line 8505
20+
 File "$DIR/semantics/python_ast_to_asr.cpp", line 8245
21+
 File "$DIR/libasr/src/libasr/containers.h", line 164
22+
LCOMPILERS_ASSERT(pos < n);
23+
AssertFailed: pos < n

tests/reference/asr-test_builtin_len-55b0dec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-test_builtin_len-55b0dec.stdout",
9-
"stdout_hash": "b2cd8402abe2c03cfa658d19260d285f3dc391c36e793b6e004f5005",
9+
"stdout_hash": "ddc8d9fe739311a02fa1ea239a40fdcf421fce2f37e3a3168b30d649",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-test_builtin_len-55b0dec.stdout

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,9 @@
564564
(Tuple
565565
[(Integer 4)
566566
(Integer 4)
567-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)]
567+
(Allocatable
568+
(String 1 () DeferredLength DescriptorString)
569+
)]
568570
)
569571
)
570572
()
@@ -612,7 +614,9 @@
612614
[(Real 8)
613615
(Logical 4)
614616
(Logical 4)
615-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)
617+
(Allocatable
618+
(String 1 () DeferredLength DescriptorString)
619+
)
616620
(Integer 4)]
617621
)
618622
)

tests/reference/asr-tuple1-09972ab.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-tuple1-09972ab.stdout",
9-
"stdout_hash": "639c2cc9a9a6db4f961bdee39fdaff3b85a4dda684ac62a51315fbc9",
9+
"stdout_hash": "978639d2781799e9f2905a4041f206549c7fbee9f7bad0c35d8f6a6d",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-tuple1-09972ab.stdout

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,15 @@
397397
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)
398398
)]
399399
(Tuple
400-
[(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)
401-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)
402-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)]
400+
[(Allocatable
401+
(String 1 () DeferredLength DescriptorString)
402+
)
403+
(Allocatable
404+
(String 1 () DeferredLength DescriptorString)
405+
)
406+
(Allocatable
407+
(String 1 () DeferredLength DescriptorString)
408+
)]
403409
)
404410
)
405411
()
@@ -446,7 +452,9 @@
446452
[(Integer 4)
447453
(Integer 4)
448454
(Real 4)
449-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)]
455+
(Allocatable
456+
(String 1 () DeferredLength DescriptorString)
457+
)]
450458
)
451459
)
452460
()
@@ -543,8 +551,12 @@
543551
)
544552
(Var 3 float_mem1)]
545553
(Tuple
546-
[(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)
547-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)
554+
[(Allocatable
555+
(String 1 () DeferredLength DescriptorString)
556+
)
557+
(Allocatable
558+
(String 1 () DeferredLength DescriptorString)
559+
)
548560
(Real 4)]
549561
)
550562
)
@@ -556,19 +568,27 @@
556568
(IntegerConstant 3 (Integer 4) Decimal)
557569
(Var 3 float_mem2)]
558570
(Tuple
559-
[(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)
571+
[(Allocatable
572+
(String 1 () DeferredLength DescriptorString)
573+
)
560574
(Integer 4)
561575
(Real 4)]
562576
)
563577
)]
564578
(Tuple
565579
[(Tuple
566-
[(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)
567-
(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)
580+
[(Allocatable
581+
(String 1 () DeferredLength DescriptorString)
582+
)
583+
(Allocatable
584+
(String 1 () DeferredLength DescriptorString)
585+
)
568586
(Real 4)]
569587
)
570588
(Tuple
571-
[(String 1 (IntegerConstant 1 (Integer 4) Decimal) ExpressionLength DescriptorString)
589+
[(Allocatable
590+
(String 1 () DeferredLength DescriptorString)
591+
)
572592
(Integer 4)
573593
(Real 4)]
574594
)]

tests/reference/c-variable_decl_03-fa1823b.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "c-variable_decl_03-fa1823b.stdout",
9-
"stdout_hash": "b8397cdd7e8998d29574393db30b5638aedd2ecd34a596b8b1c29f7f",
9+
"stdout_hash": "06db4b8826af45ad804274d183e41047f7f34ba719ec5e9b771679bb",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/c-variable_decl_03-fa1823b.stdout

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
1+
#include <math.h>
12

23
#include <stdlib.h>
34
#include <stdbool.h>
45
#include <stdio.h>
56
#include <string.h>
67
#include <lfortran_intrinsics.h>
78

8-
double _lcompilers_abs_f64(double x);
99
double f();
1010
void _xx_lcompilers_changed_main_xx();
1111
void __main__global_stmts();
1212

1313

1414

1515
// Implementations
16-
double _lcompilers_abs_f64(double x)
17-
{
18-
double _lcompilers_abs_f64;
19-
if (x >= 0.00000000000000000e+00) {
20-
_lcompilers_abs_f64 = x;
21-
} else {
22-
_lcompilers_abs_f64 = -x;
23-
}
24-
return _lcompilers_abs_f64;
25-
}
26-
2716
double f()
2817
{
2918
double _lpython_return_variable;
@@ -36,7 +25,7 @@ void _xx_lcompilers_changed_main_xx()
3625
double t1;
3726
t1 = f()* 1.00000000000000000e+06;
3827
printf("%lf\n", t1);
39-
ASSERT(_lcompilers_abs_f64(t1 - 5.50000000000000000e+00* 1.00000000000000000e+06) <= 9.99999999999999955e-07);
28+
ASSERT(fabs(t1 - 5.50000000000000000e+00* 1.00000000000000000e+06) <= 9.99999999999999955e-07);
4029
}
4130

4231
void __main__global_stmts()

0 commit comments

Comments
 (0)