Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Smit-create committed Jun 20, 2023
1 parent 13074ca commit 0c8a3c4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
7 changes: 6 additions & 1 deletion integration_tests/expr_01u.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from lpython import inline, u32, u64, i64
from lpython import inline, u32, u64, i64, i32, u16

@inline
def uadd(x: u32, y: u32) -> u32:
Expand Down Expand Up @@ -28,6 +28,11 @@ def main1():
cycles_count = u64((end_cycle - start_cycle) / num_iters)
assert cycles_count == u64(24)

# test issue 1949
x1: i32 = 20
y1: i32 = 10
assert u16(x1) > u16(y1)


main1()

Expand Down
8 changes: 8 additions & 0 deletions tests/errors/test_compare_01.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from lpython import i32, f32, i16

def f():
x: i32 = 10
y: i32 = 13
print(i16(x) > f32(y))

f()
8 changes: 8 additions & 0 deletions tests/errors/test_compare_02.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from lpython import i32, u32

def f():
x: i32 = 10
y: u32 = u32(13)
print(x > y)

f()
8 changes: 8 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,14 @@ asr = true
filename = "errors/const_02.py"
asr = true

[[test]]
filename = "errors/test_compare_01.py"
asr = true

[[test]]
filename = "errors/test_compare_02.py"
asr = true

[[test]]
filename = "parser/type_comment1.py"
ast_new = true
Expand Down

0 comments on commit 0c8a3c4

Please sign in to comment.