Skip to content

Commit f152c82

Browse files
committed
Add test file for builtins
1 parent c8a6a95 commit f152c82

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

integration_tests/run_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"modules_01.py",
1414
#"modules_02.py",
1515
"test_math.py",
16+
"test_builtin.py",
1617
]
1718

1819
def main():

integration_tests/test_builtin.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from ltypes import i32
2+
from lpython_builtin import chr, ord
3+
4+
5+
def test_ord():
6+
i: i32
7+
s: str
8+
s = "1"
9+
i = ord(s)
10+
print(i)
11+
12+
13+
def test_chr():
14+
i: i32
15+
i = 48
16+
s: str
17+
s = chr(i)
18+
print(s)
19+
20+
21+
test_ord()
22+
test_chr()

0 commit comments

Comments
 (0)