Skip to content

Commit 6852ba6

Browse files
committed
Add tests
1 parent 2f1ac30 commit 6852ba6

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ RUN(NAME test_str_to_int LABELS cpython llvm c)
391391
RUN(NAME test_platform LABELS cpython llvm c)
392392
RUN(NAME test_vars_01 LABELS cpython llvm)
393393
RUN(NAME test_version LABELS cpython llvm)
394+
RUN(NAME logical_binop1 LABELS cpython llvm)
394395
RUN(NAME vec_01 LABELS cpython llvm c)
395396
RUN(NAME test_str_comparison LABELS cpython llvm c)
396397
RUN(NAME test_bit_length LABELS cpython llvm c)

integration_tests/logical_binop1.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
from ltypes import i32
2+
3+
def test_issue_1487_1():
4+
a : i32
5+
b : i32
6+
x : i32
7+
y : i32
8+
or_op1 : i32
9+
or_op2 : i32
10+
a = 1
11+
b = 2
12+
x = 0
13+
y = 4
14+
or_op1 = a or b
15+
or_op2 = x or y
16+
assert or_op1 == 1
17+
assert or_op2 == 4
18+
y = 0
19+
or_op2 = x or y
20+
assert or_op2 == 0
21+
22+
23+
def test_issue_1487_2():
24+
a : i32
25+
b : i32
26+
x : i32
27+
y : i32
28+
and_op1 : i32
29+
and_op2 : i32
30+
a = 100
31+
b = 150
32+
x = 175
33+
y = 0
34+
and_op1 = a and b
35+
and_op2 = y and x
36+
assert and_op1 == 150
37+
assert and_op2 == 0
38+
x = 0
39+
and_op2 = y and x
40+
and_op1 = b and a
41+
assert and_op2 == 0
42+
assert and_op1 == 100
43+
44+
45+
def check():
46+
test_issue_1487_1()
47+
test_issue_1487_2()
48+
49+
50+
check()

0 commit comments

Comments
 (0)