Skip to content

Commit

Permalink
increased test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nucccc committed May 25, 2024
1 parent 5b11c4c commit 5a5cd44
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_cy_opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ def test_parent_mod():

assert func_opts2.default_float_cytyp == CyFloat.DOUBLE
assert func_opts2.default_int_cytyp == CyInt.LONG
assert func_opts2.actual_ignore_assignment_annotations == False

func_opts3 = FuncOpts(
parent_mod=mod_opts,
internal_default_float_cytyp=CyFloat.FLOAT
internal_default_float_cytyp=CyFloat.FLOAT,
ignore_assignment_annotations=True
)

assert func_opts3.default_float_cytyp == CyFloat.FLOAT
assert func_opts3.default_int_cytyp == CyInt.SHORT
assert func_opts3.default_int_cytyp == CyInt.SHORT
assert func_opts3.actual_ignore_assignment_annotations == True
8 changes: 8 additions & 0 deletions tests/test_func_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ def test_record_vartyp():
rec_coll = _record_vartyp('a', TypPrimitive(PrimitiveCod.INT), var_tracker)
assert rec_coll == CollisionEnum.NO_COLLISION

#adding a pretty weird case to increase test coverage
var_tracker = VarTypTracker(
outer_typs=DictTypStore({'a':TypPrimitive(PrimitiveCod.FLOAT)})
)

rec_coll = _record_vartyp('a', TypPrimitive(PrimitiveCod.INT), var_tracker, global_varnames={'a'})
assert rec_coll == CollisionEnum.GLOBAL_COLLISION


def test_collect_from_ast_body():

Expand Down

0 comments on commit 5a5cd44

Please sign in to comment.