From fc991ab697ef5715bd37dc4caf2d3adf02e018f3 Mon Sep 17 00:00:00 2001 From: zhs628 <111758261+zhs628@users.noreply.github.com> Date: Thu, 4 Dec 2025 21:01:29 +0800 Subject: [PATCH] Increase coverage 2025 12 01 (#412) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 通过引发py_call错误覆盖相关调用者的ok==false分支 * Revert "通过引发py_call错误覆盖相关调用者的ok==false分支" This reverts commit 36dc0b5d81a02a83dfdeca2d4d6d265f5f793b4b. * add test * rename test files * fix bugs * fix bugs --- tests/{01_int.py => 010_int.py} | 0 tests/{02_float.py => 020_float.py} | 0 tests/{03_bool.py => 030_bool.py} | 0 ..._line_continue.py => 040_line_continue.py} | 0 tests/{04_str.py => 041_str.py} | 0 tests/{05_list.py => 050_list.py} | 0 tests/{06_tuple.py => 060_tuple.py} | 0 tests/{07_listcomp.py => 070_listcomp.py} | 0 tests/{08_dict.py => 080_dict.py} | 0 tests/{08_dictcomp.py => 081_dictcomp.py} | 0 tests/{15_assign.py => 150_assign.py} | 0 tests/{15_cmp.py => 151_cmp.py} | 0 .../{15_controlflow.py => 152_controlflow.py} | 0 tests/{16_functions.py => 160_functions.py} | 0 tests/{16_typehints.py => 161_typehints.py} | 0 ..._inline_blocks.py => 240_inline_blocks.py} | 0 tests/{25_rfstring.py => 250_rfstring.py} | 0 tests/{26_multiline.py => 260_multiline.py} | 0 tests/{28_exception.py => 280_exception.py} | 0 tests/{29_iter.py => 290_iter.py} | 0 tests/{30_import.py => 300_import.py} | 0 ...31_modulereload.py => 310_modulereload.py} | 0 tests/{40_class.py => 400_class.py} | 0 tests/{41_class_ex.py => 410_class_ex.py} | 0 tests/{42_decorator.py => 420_decorator.py} | 0 tests/{43_closure.py => 430_closure.py} | 0 tests/{44_star.py => 440_star.py} | 0 tests/{46_bytes.py => 460_bytes.py} | 0 tests/{47_set.py => 470_set.py} | 0 tests/{48_setcomp.py => 480_setcomp.py} | 0 tests/{50_reflection.py => 500_reflection.py} | 0 tests/{51_yield.py => 510_yield.py} | 0 tests/{52_context.py => 520_context.py} | 0 tests/{66_eval.py => 660_eval.py} | 0 ...vs_globals.py => 670_locals_vs_globals.py} | 0 tests/{70_base64.py => 700_base64.py} | 0 tests/{70_bisect.py => 701_bisect.py} | 0 tests/{70_builtins.py => 702_builtins.py} | 0 tests/{70_heapq.py => 703_heapq.py} | 0 tests/{70_math.py => 704_math.py} | 0 tests/{70_random.py => 705_random.py} | 0 tests/{71_cmath.py => 710_cmath.py} | 0 tests/{71_gc.py => 711_gc.py} | 0 tests/{71_gc_bug.py => 712_gc_bug.py} | 0 .../{72_collections.py => 720_collections.py} | 0 tests/{72_json.py => 721_json.py} | 0 tests/{72_lz4.py => 722_lz4.py} | 0 tests/{72_msgpack.py => 723_msgpack.py} | 0 tests/{73_functools.py => 730_functools.py} | 0 tests/{73_json_alt.py => 731_json_alt.py} | 0 .../{73_json_indent.py => 732_json_indent.py} | 0 tests/{73_typing.py => 733_typing.py} | 0 tests/{74_operator.py => 740_operator.py} | 0 tests/{75_compile.py => 750_compile.py} | 0 tests/{76_dna.py => 760_dna.py} | 0 tests/{76_misc.py => 761_misc.py} | 0 tests/{76_prime.py => 762_prime.py} | 0 ...uiltin_func_1.py => 770_builtin_func_1.py} | 0 ...uiltin_func_2.py => 771_builtin_func_2.py} | 0 tests/{79_datetime.py => 790_datetime.py} | 0 tests/{79_easing.py => 791_easing.py} | 0 tests/{79_file.py => 792_file.py} | 0 tests/{80_color32.py => 800_color32.py} | 0 tests/801_sys.py | 4 + tests/{80_traceback.py => 802_traceback.py} | 2 +- tests/{80_vmath.py => 803_vmath.py} | 0 tests/80_sys.py | 4 - .../{81_dataclasses.py => 810_dataclasses.py} | 0 tests/{82_enum.py => 820_enum.py} | 0 .../{83_unicodedata.py => 830_unicodedata.py} | 0 tests/{90_array2d.py => 900_array2d.py} | 0 tests/901_array2d_extra1.py | 145 ++++++++++++++++++ ...nked_array2d.py => 902_chunked_array2d.py} | 0 tests/{90_colorcvt.py => 903_colorcvt.py} | 0 tests/{90_pickle.py => 904_pickle.py} | 0 ..._line_profiler.py => 910_line_profiler.py} | 0 tests/{92_picoterm.py => 920_picoterm.py} | 0 tests/{92_pkpy.py => 921_pkpy.py} | 0 ...ic_float.py => 930_deterministic_float.py} | 0 tests/{95_bugs.py => 950_bugs.py} | 0 tests/{95_dis.py => 951_dis.py} | 0 ...96_pep695_py312.py => 960_pep695_py312.py} | 0 tests/{97_inspect.py => 970_inspect.py} | 0 tests/{98_thread.py => 980_thread.py} | 0 tests/{99_extras.py => 990_extras.py} | 0 85 files changed, 150 insertions(+), 5 deletions(-) rename tests/{01_int.py => 010_int.py} (100%) rename tests/{02_float.py => 020_float.py} (100%) rename tests/{03_bool.py => 030_bool.py} (100%) rename tests/{04_line_continue.py => 040_line_continue.py} (100%) rename tests/{04_str.py => 041_str.py} (100%) rename tests/{05_list.py => 050_list.py} (100%) rename tests/{06_tuple.py => 060_tuple.py} (100%) rename tests/{07_listcomp.py => 070_listcomp.py} (100%) rename tests/{08_dict.py => 080_dict.py} (100%) rename tests/{08_dictcomp.py => 081_dictcomp.py} (100%) rename tests/{15_assign.py => 150_assign.py} (100%) rename tests/{15_cmp.py => 151_cmp.py} (100%) rename tests/{15_controlflow.py => 152_controlflow.py} (100%) rename tests/{16_functions.py => 160_functions.py} (100%) rename tests/{16_typehints.py => 161_typehints.py} (100%) rename tests/{24_inline_blocks.py => 240_inline_blocks.py} (100%) rename tests/{25_rfstring.py => 250_rfstring.py} (100%) rename tests/{26_multiline.py => 260_multiline.py} (100%) rename tests/{28_exception.py => 280_exception.py} (100%) rename tests/{29_iter.py => 290_iter.py} (100%) rename tests/{30_import.py => 300_import.py} (100%) rename tests/{31_modulereload.py => 310_modulereload.py} (100%) rename tests/{40_class.py => 400_class.py} (100%) rename tests/{41_class_ex.py => 410_class_ex.py} (100%) rename tests/{42_decorator.py => 420_decorator.py} (100%) rename tests/{43_closure.py => 430_closure.py} (100%) rename tests/{44_star.py => 440_star.py} (100%) rename tests/{46_bytes.py => 460_bytes.py} (100%) rename tests/{47_set.py => 470_set.py} (100%) rename tests/{48_setcomp.py => 480_setcomp.py} (100%) rename tests/{50_reflection.py => 500_reflection.py} (100%) rename tests/{51_yield.py => 510_yield.py} (100%) rename tests/{52_context.py => 520_context.py} (100%) rename tests/{66_eval.py => 660_eval.py} (100%) rename tests/{67_locals_vs_globals.py => 670_locals_vs_globals.py} (100%) rename tests/{70_base64.py => 700_base64.py} (100%) rename tests/{70_bisect.py => 701_bisect.py} (100%) rename tests/{70_builtins.py => 702_builtins.py} (100%) rename tests/{70_heapq.py => 703_heapq.py} (100%) rename tests/{70_math.py => 704_math.py} (100%) rename tests/{70_random.py => 705_random.py} (100%) rename tests/{71_cmath.py => 710_cmath.py} (100%) rename tests/{71_gc.py => 711_gc.py} (100%) rename tests/{71_gc_bug.py => 712_gc_bug.py} (100%) rename tests/{72_collections.py => 720_collections.py} (100%) rename tests/{72_json.py => 721_json.py} (100%) rename tests/{72_lz4.py => 722_lz4.py} (100%) rename tests/{72_msgpack.py => 723_msgpack.py} (100%) rename tests/{73_functools.py => 730_functools.py} (100%) rename tests/{73_json_alt.py => 731_json_alt.py} (100%) rename tests/{73_json_indent.py => 732_json_indent.py} (100%) rename tests/{73_typing.py => 733_typing.py} (100%) rename tests/{74_operator.py => 740_operator.py} (100%) rename tests/{75_compile.py => 750_compile.py} (100%) rename tests/{76_dna.py => 760_dna.py} (100%) rename tests/{76_misc.py => 761_misc.py} (100%) rename tests/{76_prime.py => 762_prime.py} (100%) rename tests/{77_builtin_func_1.py => 770_builtin_func_1.py} (100%) rename tests/{77_builtin_func_2.py => 771_builtin_func_2.py} (100%) rename tests/{79_datetime.py => 790_datetime.py} (100%) rename tests/{79_easing.py => 791_easing.py} (100%) rename tests/{79_file.py => 792_file.py} (100%) rename tests/{80_color32.py => 800_color32.py} (100%) create mode 100644 tests/801_sys.py rename tests/{80_traceback.py => 802_traceback.py} (89%) rename tests/{80_vmath.py => 803_vmath.py} (100%) delete mode 100644 tests/80_sys.py rename tests/{81_dataclasses.py => 810_dataclasses.py} (100%) rename tests/{82_enum.py => 820_enum.py} (100%) rename tests/{83_unicodedata.py => 830_unicodedata.py} (100%) rename tests/{90_array2d.py => 900_array2d.py} (100%) create mode 100644 tests/901_array2d_extra1.py rename tests/{90_chunked_array2d.py => 902_chunked_array2d.py} (100%) rename tests/{90_colorcvt.py => 903_colorcvt.py} (100%) rename tests/{90_pickle.py => 904_pickle.py} (100%) rename tests/{91_line_profiler.py => 910_line_profiler.py} (100%) rename tests/{92_picoterm.py => 920_picoterm.py} (100%) rename tests/{92_pkpy.py => 921_pkpy.py} (100%) rename tests/{93_deterministic_float.py => 930_deterministic_float.py} (100%) rename tests/{95_bugs.py => 950_bugs.py} (100%) rename tests/{95_dis.py => 951_dis.py} (100%) rename tests/{96_pep695_py312.py => 960_pep695_py312.py} (100%) rename tests/{97_inspect.py => 970_inspect.py} (100%) rename tests/{98_thread.py => 980_thread.py} (100%) rename tests/{99_extras.py => 990_extras.py} (100%) diff --git a/tests/01_int.py b/tests/010_int.py similarity index 100% rename from tests/01_int.py rename to tests/010_int.py diff --git a/tests/02_float.py b/tests/020_float.py similarity index 100% rename from tests/02_float.py rename to tests/020_float.py diff --git a/tests/03_bool.py b/tests/030_bool.py similarity index 100% rename from tests/03_bool.py rename to tests/030_bool.py diff --git a/tests/04_line_continue.py b/tests/040_line_continue.py similarity index 100% rename from tests/04_line_continue.py rename to tests/040_line_continue.py diff --git a/tests/04_str.py b/tests/041_str.py similarity index 100% rename from tests/04_str.py rename to tests/041_str.py diff --git a/tests/05_list.py b/tests/050_list.py similarity index 100% rename from tests/05_list.py rename to tests/050_list.py diff --git a/tests/06_tuple.py b/tests/060_tuple.py similarity index 100% rename from tests/06_tuple.py rename to tests/060_tuple.py diff --git a/tests/07_listcomp.py b/tests/070_listcomp.py similarity index 100% rename from tests/07_listcomp.py rename to tests/070_listcomp.py diff --git a/tests/08_dict.py b/tests/080_dict.py similarity index 100% rename from tests/08_dict.py rename to tests/080_dict.py diff --git a/tests/08_dictcomp.py b/tests/081_dictcomp.py similarity index 100% rename from tests/08_dictcomp.py rename to tests/081_dictcomp.py diff --git a/tests/15_assign.py b/tests/150_assign.py similarity index 100% rename from tests/15_assign.py rename to tests/150_assign.py diff --git a/tests/15_cmp.py b/tests/151_cmp.py similarity index 100% rename from tests/15_cmp.py rename to tests/151_cmp.py diff --git a/tests/15_controlflow.py b/tests/152_controlflow.py similarity index 100% rename from tests/15_controlflow.py rename to tests/152_controlflow.py diff --git a/tests/16_functions.py b/tests/160_functions.py similarity index 100% rename from tests/16_functions.py rename to tests/160_functions.py diff --git a/tests/16_typehints.py b/tests/161_typehints.py similarity index 100% rename from tests/16_typehints.py rename to tests/161_typehints.py diff --git a/tests/24_inline_blocks.py b/tests/240_inline_blocks.py similarity index 100% rename from tests/24_inline_blocks.py rename to tests/240_inline_blocks.py diff --git a/tests/25_rfstring.py b/tests/250_rfstring.py similarity index 100% rename from tests/25_rfstring.py rename to tests/250_rfstring.py diff --git a/tests/26_multiline.py b/tests/260_multiline.py similarity index 100% rename from tests/26_multiline.py rename to tests/260_multiline.py diff --git a/tests/28_exception.py b/tests/280_exception.py similarity index 100% rename from tests/28_exception.py rename to tests/280_exception.py diff --git a/tests/29_iter.py b/tests/290_iter.py similarity index 100% rename from tests/29_iter.py rename to tests/290_iter.py diff --git a/tests/30_import.py b/tests/300_import.py similarity index 100% rename from tests/30_import.py rename to tests/300_import.py diff --git a/tests/31_modulereload.py b/tests/310_modulereload.py similarity index 100% rename from tests/31_modulereload.py rename to tests/310_modulereload.py diff --git a/tests/40_class.py b/tests/400_class.py similarity index 100% rename from tests/40_class.py rename to tests/400_class.py diff --git a/tests/41_class_ex.py b/tests/410_class_ex.py similarity index 100% rename from tests/41_class_ex.py rename to tests/410_class_ex.py diff --git a/tests/42_decorator.py b/tests/420_decorator.py similarity index 100% rename from tests/42_decorator.py rename to tests/420_decorator.py diff --git a/tests/43_closure.py b/tests/430_closure.py similarity index 100% rename from tests/43_closure.py rename to tests/430_closure.py diff --git a/tests/44_star.py b/tests/440_star.py similarity index 100% rename from tests/44_star.py rename to tests/440_star.py diff --git a/tests/46_bytes.py b/tests/460_bytes.py similarity index 100% rename from tests/46_bytes.py rename to tests/460_bytes.py diff --git a/tests/47_set.py b/tests/470_set.py similarity index 100% rename from tests/47_set.py rename to tests/470_set.py diff --git a/tests/48_setcomp.py b/tests/480_setcomp.py similarity index 100% rename from tests/48_setcomp.py rename to tests/480_setcomp.py diff --git a/tests/50_reflection.py b/tests/500_reflection.py similarity index 100% rename from tests/50_reflection.py rename to tests/500_reflection.py diff --git a/tests/51_yield.py b/tests/510_yield.py similarity index 100% rename from tests/51_yield.py rename to tests/510_yield.py diff --git a/tests/52_context.py b/tests/520_context.py similarity index 100% rename from tests/52_context.py rename to tests/520_context.py diff --git a/tests/66_eval.py b/tests/660_eval.py similarity index 100% rename from tests/66_eval.py rename to tests/660_eval.py diff --git a/tests/67_locals_vs_globals.py b/tests/670_locals_vs_globals.py similarity index 100% rename from tests/67_locals_vs_globals.py rename to tests/670_locals_vs_globals.py diff --git a/tests/70_base64.py b/tests/700_base64.py similarity index 100% rename from tests/70_base64.py rename to tests/700_base64.py diff --git a/tests/70_bisect.py b/tests/701_bisect.py similarity index 100% rename from tests/70_bisect.py rename to tests/701_bisect.py diff --git a/tests/70_builtins.py b/tests/702_builtins.py similarity index 100% rename from tests/70_builtins.py rename to tests/702_builtins.py diff --git a/tests/70_heapq.py b/tests/703_heapq.py similarity index 100% rename from tests/70_heapq.py rename to tests/703_heapq.py diff --git a/tests/70_math.py b/tests/704_math.py similarity index 100% rename from tests/70_math.py rename to tests/704_math.py diff --git a/tests/70_random.py b/tests/705_random.py similarity index 100% rename from tests/70_random.py rename to tests/705_random.py diff --git a/tests/71_cmath.py b/tests/710_cmath.py similarity index 100% rename from tests/71_cmath.py rename to tests/710_cmath.py diff --git a/tests/71_gc.py b/tests/711_gc.py similarity index 100% rename from tests/71_gc.py rename to tests/711_gc.py diff --git a/tests/71_gc_bug.py b/tests/712_gc_bug.py similarity index 100% rename from tests/71_gc_bug.py rename to tests/712_gc_bug.py diff --git a/tests/72_collections.py b/tests/720_collections.py similarity index 100% rename from tests/72_collections.py rename to tests/720_collections.py diff --git a/tests/72_json.py b/tests/721_json.py similarity index 100% rename from tests/72_json.py rename to tests/721_json.py diff --git a/tests/72_lz4.py b/tests/722_lz4.py similarity index 100% rename from tests/72_lz4.py rename to tests/722_lz4.py diff --git a/tests/72_msgpack.py b/tests/723_msgpack.py similarity index 100% rename from tests/72_msgpack.py rename to tests/723_msgpack.py diff --git a/tests/73_functools.py b/tests/730_functools.py similarity index 100% rename from tests/73_functools.py rename to tests/730_functools.py diff --git a/tests/73_json_alt.py b/tests/731_json_alt.py similarity index 100% rename from tests/73_json_alt.py rename to tests/731_json_alt.py diff --git a/tests/73_json_indent.py b/tests/732_json_indent.py similarity index 100% rename from tests/73_json_indent.py rename to tests/732_json_indent.py diff --git a/tests/73_typing.py b/tests/733_typing.py similarity index 100% rename from tests/73_typing.py rename to tests/733_typing.py diff --git a/tests/74_operator.py b/tests/740_operator.py similarity index 100% rename from tests/74_operator.py rename to tests/740_operator.py diff --git a/tests/75_compile.py b/tests/750_compile.py similarity index 100% rename from tests/75_compile.py rename to tests/750_compile.py diff --git a/tests/76_dna.py b/tests/760_dna.py similarity index 100% rename from tests/76_dna.py rename to tests/760_dna.py diff --git a/tests/76_misc.py b/tests/761_misc.py similarity index 100% rename from tests/76_misc.py rename to tests/761_misc.py diff --git a/tests/76_prime.py b/tests/762_prime.py similarity index 100% rename from tests/76_prime.py rename to tests/762_prime.py diff --git a/tests/77_builtin_func_1.py b/tests/770_builtin_func_1.py similarity index 100% rename from tests/77_builtin_func_1.py rename to tests/770_builtin_func_1.py diff --git a/tests/77_builtin_func_2.py b/tests/771_builtin_func_2.py similarity index 100% rename from tests/77_builtin_func_2.py rename to tests/771_builtin_func_2.py diff --git a/tests/79_datetime.py b/tests/790_datetime.py similarity index 100% rename from tests/79_datetime.py rename to tests/790_datetime.py diff --git a/tests/79_easing.py b/tests/791_easing.py similarity index 100% rename from tests/79_easing.py rename to tests/791_easing.py diff --git a/tests/79_file.py b/tests/792_file.py similarity index 100% rename from tests/79_file.py rename to tests/792_file.py diff --git a/tests/80_color32.py b/tests/800_color32.py similarity index 100% rename from tests/80_color32.py rename to tests/800_color32.py diff --git a/tests/801_sys.py b/tests/801_sys.py new file mode 100644 index 00000000..2a91949a --- /dev/null +++ b/tests/801_sys.py @@ -0,0 +1,4 @@ +import sys + +assert len(sys.argv) == 2 +assert (sys.argv[1] == 'tests/801_sys.py'), sys.argv diff --git a/tests/80_traceback.py b/tests/802_traceback.py similarity index 89% rename from tests/80_traceback.py rename to tests/802_traceback.py index d3a4b840..42750226 100644 --- a/tests/80_traceback.py +++ b/tests/802_traceback.py @@ -7,7 +7,7 @@ except KeyError: actual = traceback.format_exc() expected = '''Traceback (most recent call last): - File "tests/80_traceback.py", line 5 + File "tests/802_traceback.py", line 5 b = a[6] KeyError: 6''' diff --git a/tests/80_vmath.py b/tests/803_vmath.py similarity index 100% rename from tests/80_vmath.py rename to tests/803_vmath.py diff --git a/tests/80_sys.py b/tests/80_sys.py deleted file mode 100644 index f60f65cf..00000000 --- a/tests/80_sys.py +++ /dev/null @@ -1,4 +0,0 @@ -import sys - -assert len(sys.argv) == 2 -assert (sys.argv[1] == 'tests/80_sys.py'), sys.argv diff --git a/tests/81_dataclasses.py b/tests/810_dataclasses.py similarity index 100% rename from tests/81_dataclasses.py rename to tests/810_dataclasses.py diff --git a/tests/82_enum.py b/tests/820_enum.py similarity index 100% rename from tests/82_enum.py rename to tests/820_enum.py diff --git a/tests/83_unicodedata.py b/tests/830_unicodedata.py similarity index 100% rename from tests/83_unicodedata.py rename to tests/830_unicodedata.py diff --git a/tests/90_array2d.py b/tests/900_array2d.py similarity index 100% rename from tests/90_array2d.py rename to tests/900_array2d.py diff --git a/tests/901_array2d_extra1.py b/tests/901_array2d_extra1.py new file mode 100644 index 00000000..b5b42e6e --- /dev/null +++ b/tests/901_array2d_extra1.py @@ -0,0 +1,145 @@ +from array2d import array2d, chunked_array2d +from vmath import color32, vec2i + +''' +src/modules/array2d.c +''' + +# =====array2d_like_render +data = [ + [1,2,3], + [4,5,6], +] +assert array2d.fromlist(data).render() == "123\n456" + +# ====array2d_like_render_with_color +text_data = [] +color_fg = [] +color_bg = [] +for i in range(51): + r = i * 5 # r in [0,5,10,15...250,255] + g = i * 5 # g in [0,5,10,15...250,255] + + row_fg = [] + row_bg = [] + row_text_data = [] + for j in range(51): + b = j * 5 # j in [0,5,10,15...250,255] + row_fg.append(color32(255-r, 255-g, 255-b, 255)) + row_bg.append(color32(r, g, b, 255)) + row_text_data.append("A") + + color_fg.append(row_fg) + color_bg.append(row_bg) + text_data.append(row_text_data) + + +array2d.fromlist(text_data).render_with_color( + array2d.fromlist(color_fg), + array2d.fromlist(color_bg) + ) + +array2d.fromlist(text_data).render_with_color( + array2d.fromlist(color_fg), + array2d(51, 51, None) + ) + +array2d.fromlist(text_data).render_with_color( + array2d(51, 51, None), + array2d.fromlist(color_bg) + ) + +# (curr_fg.u32 != 0 || curr_bg.u32 != 0) == false +array2d.fromlist(text_data).render_with_color( + array2d(51, 51, None), + array2d(51, 51, None) + ) + +try: + array2d.fromlist(text_data).render_with_color( + array2d.fromlist(color_fg), + array2d(51, 51, 1) + ) + assert False, "here expect a TypeError" +except TypeError as e: + assert "color32" in str(e) or "None" in str(e) + +try: + array2d.fromlist(text_data).render_with_color( + array2d(51, 51, 1), + array2d.fromlist(color_bg) + ) + assert False, "here expect a TypeError" +except TypeError as e: + assert "color32" in str(e) or "None" in str(e) + + +# ====array2d_like_any +data = [[False, False], [False, False]] +assert array2d.fromlist(data).any() == False + +# ====c11_array2d_view__set +data = chunked_array2d(4) +data[vec2i(3,3)] = 0 +data.view()[1,1] = 10 +assert data.view() == array2d.fromlist([ + [None, None, None, None,], + [None, 10, None, None,], + [None, None, 0, None,], + [None, None, None, None,], + ]) + +# ====array2d_view_origin +assert data.view()[vec2i(1,1)-data.view().origin] == data[vec2i(1,1)] +assert data.view()[vec2i(3,3)-data.view().origin] == data[vec2i(3,3)] + +# ====chunked_array2d__delitem__ +data = chunked_array2d(4) +for i in range(10): + for j in range(10): + data[vec2i(i,j)] = 10 + +del data[vec2i(0,0)] +assert data[vec2i(0,0)] == data.default + +# ====chunked_array2d__len__ +data = chunked_array2d(4) +for i in range(10): + for j in range(10): + data[vec2i(i,j)] = 10 + +assert len(data) == 9 + +# ====c11_chunked_array2d__mark +import gc + +def gc_collect_callback(statue, msg): + if statue == 'stop': + for line in msg.split('\n'): + print(line) + if "5290" in line and "str" in line: + return + print(msg) + raise AssertionError("Expected GC output not found") + +gc.collect() +gc.setup_debug_callback(gc_collect_callback) +def create_garbage(): + data = chunked_array2d(4) + # [str ] small: 0 large: 5290 + for x in range(23): + for y in range(230): + data[vec2i(x, y)] = "garbage"*100 + +create_garbage() +gc.collect() + + +# ====chunked_array2d_view_chunks +data = chunked_array2d(4, default = 0) +data[vec2i(-10,-10)] = -1 +assert data.view_chunks(vec2i(-3, -3), 6, 6)[vec2i(2, 2)] == -1 +data.view_chunks(vec2i(-3, -3), 6, 6)[vec2i(22, 22)] = 1 +assert data[vec2i(10,10)] == 1 + + diff --git a/tests/90_chunked_array2d.py b/tests/902_chunked_array2d.py similarity index 100% rename from tests/90_chunked_array2d.py rename to tests/902_chunked_array2d.py diff --git a/tests/90_colorcvt.py b/tests/903_colorcvt.py similarity index 100% rename from tests/90_colorcvt.py rename to tests/903_colorcvt.py diff --git a/tests/90_pickle.py b/tests/904_pickle.py similarity index 100% rename from tests/90_pickle.py rename to tests/904_pickle.py diff --git a/tests/91_line_profiler.py b/tests/910_line_profiler.py similarity index 100% rename from tests/91_line_profiler.py rename to tests/910_line_profiler.py diff --git a/tests/92_picoterm.py b/tests/920_picoterm.py similarity index 100% rename from tests/92_picoterm.py rename to tests/920_picoterm.py diff --git a/tests/92_pkpy.py b/tests/921_pkpy.py similarity index 100% rename from tests/92_pkpy.py rename to tests/921_pkpy.py diff --git a/tests/93_deterministic_float.py b/tests/930_deterministic_float.py similarity index 100% rename from tests/93_deterministic_float.py rename to tests/930_deterministic_float.py diff --git a/tests/95_bugs.py b/tests/950_bugs.py similarity index 100% rename from tests/95_bugs.py rename to tests/950_bugs.py diff --git a/tests/95_dis.py b/tests/951_dis.py similarity index 100% rename from tests/95_dis.py rename to tests/951_dis.py diff --git a/tests/96_pep695_py312.py b/tests/960_pep695_py312.py similarity index 100% rename from tests/96_pep695_py312.py rename to tests/960_pep695_py312.py diff --git a/tests/97_inspect.py b/tests/970_inspect.py similarity index 100% rename from tests/97_inspect.py rename to tests/970_inspect.py diff --git a/tests/98_thread.py b/tests/980_thread.py similarity index 100% rename from tests/98_thread.py rename to tests/980_thread.py diff --git a/tests/99_extras.py b/tests/990_extras.py similarity index 100% rename from tests/99_extras.py rename to tests/990_extras.py