Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Mar 3, 2024
1 parent e39da27 commit 09baada
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ RUN(NAME test_gruntz LABELS cpython_sym c_sym llvm_sym NOFAST)
RUN(NAME symbolics_15 LABELS c_sym llvm_sym NOFAST)
RUN(NAME symbolics_16 LABELS cpython_sym c_sym llvm_sym NOFAST)
RUN(NAME symbolics_17 LABELS cpython_sym c_sym llvm_sym NOFAST)
RUN(NAME symbolics_18 LABELS cpython_sym c_sym llvm_sym NOFAST)

RUN(NAME sizeof_01 LABELS llvm c
EXTRAFILES sizeof_01b.c)
Expand Down
36 changes: 36 additions & 0 deletions integration_tests/symbolics_18.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from lpython import S
from sympy import Symbol, log

def func_01(e: S, x: S) -> S:
print(e)
if e == x:
return x
print(e)
return e

def test_func_01():
x: S = Symbol("x")
ans: S = func_01(log(x), x)
print(ans)

def func_02(e: S, x: S) -> list[S]:
print(e)
if e == x:
list1: list[S] = [x]
return list1
else:
print(e)
list2: list[S] = func_02(x, x)
return list2

def test_func_02():
x: S = Symbol("x")
ans: list[S] = func_02(log(x), x)
ele: S = ans[0]
print(ele)

def tests():
test_func_01()
test_func_02()

tests()

0 comments on commit 09baada

Please sign in to comment.