Skip to content

Commit 2a4c3e0

Browse files
committed
TEST: Add test for ifexp
Rename existing test_ifexp.py to test_ifexp_01.py
1 parent 67eac51 commit 2a4c3e0

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

integration_tests/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,8 @@ RUN(NAME test_global LABELS cpython llvm c)
554554
RUN(NAME test_global_decl LABELS cpython llvm c)
555555
RUN(NAME test_integer_bitnot LABELS cpython llvm c wasm)
556556
RUN(NAME test_unsign_int_bitnot LABELS cpython llvm c)
557-
RUN(NAME test_ifexp LABELS cpython llvm c)
557+
RUN(NAME test_ifexp_01 LABELS cpython llvm c)
558+
RUN(NAME test_ifexp_02 LABELS cpython llvm c)
558559
RUN(NAME test_unary_minus LABELS cpython llvm c)
559560
RUN(NAME test_unary_plus LABELS cpython llvm c)
560561
RUN(NAME test_bool_binop LABELS cpython llvm c)

integration_tests/test_ifexp_02.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from lpython import i32
2+
3+
def g() -> i32:
4+
return 10
5+
6+
def f():
7+
i: i32
8+
j: i32
9+
k: i32
10+
i = 5
11+
j = 6
12+
k = g() if i > j else g() - 1
13+
14+
print(k)
15+
assert k == 9
16+
17+
f()

0 commit comments

Comments
 (0)