Skip to content

Commit

Permalink
Convert tests to call main()
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Feb 4, 2022
1 parent ef979a3 commit 062d04b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
5 changes: 3 additions & 2 deletions integration_tests/expr_01.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
def main()->i32:
def main0():
x: i32
x = (2+3)*5
print(x)
return 0

main0()

# Not implemented yet in LPython:
#if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/expr_02.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
def main()->i32:
def main0():
a: bool
b: bool
a = False
b = True
a = a and b
b = a or True
a = a or b
return 0

main0()
# Not implemented yet in LPython:
#if __name__ == "__main__":
# main()
5 changes: 3 additions & 2 deletions integration_tests/expr_03.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def main() -> i32:
def main0():
x: i32
x = 5
result: i32
Expand All @@ -7,4 +7,5 @@ def main() -> i32:
result = result * x
x -= 1
print(result)
return 0

main0()
5 changes: 3 additions & 2 deletions integration_tests/expr_04.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def main() -> i32:
def main0():
i: i32
sum: i32
for i in range(0, 10):
Expand All @@ -8,4 +8,5 @@ def main() -> i32:
if i > 5:
break
print(sum)
return 0

main0()
5 changes: 3 additions & 2 deletions integration_tests/expr_05.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
def test_multiply(a: i32, b: i32) -> i32:
return a*b

def main() -> i32:
def main0():
a: i32
b: i32
a = 10
b = -5
print(test_multiply(a, b))
return 0

main0()
5 changes: 3 additions & 2 deletions integration_tests/modules_01.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from modules_01b import f #, g

def main()->i32:
def main0():
x: i32
x = (2+3)*5
print(x)
f()
# x = g()
# print(x)
return 0

main0()
5 changes: 3 additions & 2 deletions integration_tests/modules_02.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from modules_02b import f

def main()->i32:
def main0():
x: i32
x = (2+3)*5
print(x)
f()
return 0

main0()

0 comments on commit 062d04b

Please sign in to comment.