Skip to content

Commit

Permalink
Added tests for errors while passing keyword arguments to functions
Browse files Browse the repository at this point in the history
  • Loading branch information
czgdp1807 committed Sep 2, 2022
1 parent 6f65420 commit 2f3064c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/errors/kwargs_01_error.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from ltypes import i32, i64, f32, f64, c64, overload

def func01(a: i32, b: i64) -> i64:
return int(a) + b

def test_arg_passing():
arg1: i32;

arg1 = 1

func01(arg1, a=int(8))

test_arg_passing()
15 changes: 15 additions & 0 deletions tests/errors/kwargs_02_error.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from ltypes import f32, f64, c64

def func02(a: f32, b: f64, c: c64) -> c64:
return complex(float(a), b) + c

def test_arg_passing():
arg3: f32; arg4: f64; arg5: c64;

arg3 = 3.0
arg4 = float(4.0)
arg5 = complex(5.0, 5.0)

func02(arg3, arg4, c=arg5, b=arg4)

test_arg_passing()
13 changes: 13 additions & 0 deletions tests/errors/kwargs_03_error.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from ltypes import i32, i64, f32, f64, c64, overload

def func01(a: i32, b: i64) -> i64:
return int(a) + b

def test_arg_passing():
arg1: i32;

arg1 = 1

func01(arg1, d=int(8))

test_arg_passing()

0 comments on commit 2f3064c

Please sign in to comment.