From 5a5cd448a247ae0beda875cd240f7cc4030a9023 Mon Sep 17 00:00:00 2001 From: nucccc Date: Sat, 25 May 2024 10:02:46 +0200 Subject: [PATCH] increased test coverage --- tests/test_cy_opts.py | 7 +++++-- tests/test_func_collect.py | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/test_cy_opts.py b/tests/test_cy_opts.py index 6d152ad..5b31ed5 100644 --- a/tests/test_cy_opts.py +++ b/tests/test_cy_opts.py @@ -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 \ No newline at end of file + assert func_opts3.default_int_cytyp == CyInt.SHORT + assert func_opts3.actual_ignore_assignment_annotations == True \ No newline at end of file diff --git a/tests/test_func_collect.py b/tests/test_func_collect.py index 6fb3ee1..eccb1d9 100644 --- a/tests/test_func_collect.py +++ b/tests/test_func_collect.py @@ -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():