data-structure-typed 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/CMakeLists.txt +52 -0
- package/README.md +4 -4
- package/README_CN.md +5 -5
- package/benchmark/report.html +141 -12
- package/benchmark/report.json +1969 -38
- package/build/CMakeCache.txt +603 -0
- package/build/CMakeFiles/4.0.3/CMakeCXXCompiler.cmake +104 -0
- package/build/CMakeFiles/4.0.3/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/build/CMakeFiles/4.0.3/CMakeSystem.cmake +15 -0
- package/build/CMakeFiles/4.0.3/CompilerIdCXX/CMakeCXXCompilerId.cpp +920 -0
- package/build/CMakeFiles/4.0.3/CompilerIdCXX/a.out +0 -0
- package/build/CMakeFiles/4.0.3/CompilerIdCXX/apple-sdk.cpp +1 -0
- package/build/CMakeFiles/CMakeConfigureLog.yaml +2146 -0
- package/build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- package/build/CMakeFiles/InstallScripts.json +9 -0
- package/build/CMakeFiles/Makefile.cmake +100 -0
- package/build/CMakeFiles/Makefile2 +720 -0
- package/build/CMakeFiles/TargetDirectories.txt +23 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/test/performance/data-structures/binary-tree/avl-rb-range-search.test.cpp.o +0 -0
- package/build/CMakeFiles/avl-rb-range-search-benchmark.dir/test/performance/data-structures/binary-tree/avl-rb-range-search.test.cpp.o.d +835 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/test/performance/data-structures/binary-tree/avl-tree.test.cpp.o +0 -0
- package/build/CMakeFiles/avl-tree-benchmark.dir/test/performance/data-structures/binary-tree/avl-tree.test.cpp.o.d +835 -0
- package/build/CMakeFiles/cmake.check_cache +1 -0
- package/build/CMakeFiles/deque-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/deque-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/deque-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/deque-benchmark.dir/compiler_depend.internal +791 -0
- package/build/CMakeFiles/deque-benchmark.dir/compiler_depend.make +2362 -0
- package/build/CMakeFiles/deque-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/deque-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/deque-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/deque-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/deque-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/deque-benchmark.dir/test/performance/data-structures/queue/deque.test.cpp.o +0 -0
- package/build/CMakeFiles/deque-benchmark.dir/test/performance/data-structures/queue/deque.test.cpp.o.d +787 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/compiler_depend.internal +790 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/compiler_depend.make +2359 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/doubly-linked-list.test.cpp.o +0 -0
- package/build/CMakeFiles/doubly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/doubly-linked-list.test.cpp.o.d +786 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/compiler_depend.internal +790 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/compiler_depend.make +2359 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/test/performance/data-structures/hash/hash-map.test.cpp.o +0 -0
- package/build/CMakeFiles/hash-map-benchmark.dir/test/performance/data-structures/hash/hash-map.test.cpp.o.d +786 -0
- package/build/CMakeFiles/heap-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/heap-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/heap-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/heap-benchmark.dir/compiler_depend.internal +843 -0
- package/build/CMakeFiles/heap-benchmark.dir/compiler_depend.make +2518 -0
- package/build/CMakeFiles/heap-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/heap-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/heap-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/heap-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/heap-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/heap-benchmark.dir/test/performance/data-structures/heap/heap.test.cpp.o +0 -0
- package/build/CMakeFiles/heap-benchmark.dir/test/performance/data-structures/heap/heap.test.cpp.o.d +839 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/compiler_depend.internal +793 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/compiler_depend.make +2368 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/test/performance/data-structures/priority-queue/priority-queue.test.cpp.o +0 -0
- package/build/CMakeFiles/priority-queue-benchmark.dir/test/performance/data-structures/priority-queue/priority-queue.test.cpp.o.d +789 -0
- package/build/CMakeFiles/progress.marks +1 -0
- package/build/CMakeFiles/queue-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/queue-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/queue-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/queue-benchmark.dir/compiler_depend.internal +793 -0
- package/build/CMakeFiles/queue-benchmark.dir/compiler_depend.make +2368 -0
- package/build/CMakeFiles/queue-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/queue-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/queue-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/queue-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/queue-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/queue-benchmark.dir/test/performance/data-structures/queue/queue.test.cpp.o +0 -0
- package/build/CMakeFiles/queue-benchmark.dir/test/performance/data-structures/queue/queue.test.cpp.o.d +789 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/test/performance/data-structures/binary-tree/red-black-tree.test.cpp.o +0 -0
- package/build/CMakeFiles/red-black-tree-benchmark.dir/test/performance/data-structures/binary-tree/red-black-tree.test.cpp.o.d +835 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/compiler_depend.internal +790 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/compiler_depend.make +2359 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/singly-linked-list.test.cpp.o +0 -0
- package/build/CMakeFiles/singly-linked-list-benchmark.dir/test/performance/data-structures/linked-list/singly-linked-list.test.cpp.o.d +786 -0
- package/build/CMakeFiles/stack-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/stack-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/stack-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/stack-benchmark.dir/compiler_depend.internal +793 -0
- package/build/CMakeFiles/stack-benchmark.dir/compiler_depend.make +2368 -0
- package/build/CMakeFiles/stack-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/stack-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/stack-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/stack-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/stack-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/stack-benchmark.dir/test/performance/data-structures/stack/stack.test.cpp.o +0 -0
- package/build/CMakeFiles/stack-benchmark.dir/test/performance/data-structures/stack/stack.test.cpp.o.d +789 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-map.test.cpp.o +0 -0
- package/build/CMakeFiles/tree-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-map.test.cpp.o.d +835 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-map.test.cpp.o +0 -0
- package/build/CMakeFiles/tree-multi-map-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-map.test.cpp.o.d +835 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-set.test.cpp.o +0 -0
- package/build/CMakeFiles/tree-multi-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-multi-set.test.cpp.o.d +835 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/DependInfo.cmake +23 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/build.make +114 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/cmake_clean.cmake +11 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/compiler_depend.internal +839 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/compiler_depend.make +2506 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/compiler_depend.ts +2 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/depend.make +2 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/flags.make +10 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/link.txt +1 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/progress.make +3 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-set.test.cpp.o +0 -0
- package/build/CMakeFiles/tree-set-benchmark.dir/test/performance/data-structures/binary-tree/tree-set.test.cpp.o.d +835 -0
- package/build/Makefile +783 -0
- package/build/_deps/benchmark-build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- package/build/_deps/benchmark-build/CMakeFiles/progress.marks +1 -0
- package/build/_deps/benchmark-build/Makefile +140 -0
- package/build/_deps/benchmark-build/benchmark.pc +12 -0
- package/build/_deps/benchmark-build/benchmarkConfig.cmake +14 -0
- package/build/_deps/benchmark-build/benchmarkConfigVersion.cmake +65 -0
- package/build/_deps/benchmark-build/benchmarkTargets.cmake +84 -0
- package/build/_deps/benchmark-build/cmake_install.cmake +50 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/DependInfo.cmake +41 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark.cc.o.d +875 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_api_internal.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_api_internal.cc.o.d +802 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_name.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_name.cc.o.d +772 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o.d +841 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_runner.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/benchmark_runner.cc.o.d +833 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/build.make +402 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/check.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/check.cc.o.d +784 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/cmake_clean.cmake +47 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/cmake_clean_target.cmake +3 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/colorprint.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/colorprint.cc.o.d +791 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/commandlineflags.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/commandlineflags.cc.o.d +795 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/compiler_depend.internal +15519 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/compiler_depend.make +17500 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/compiler_depend.ts +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/complexity.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/complexity.cc.o.d +793 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/console_reporter.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/console_reporter.cc.o.d +802 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/counter.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/counter.cc.o.d +773 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/csv_reporter.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/csv_reporter.cc.o.d +799 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/depend.make +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/flags.make +10 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/json_reporter.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/json_reporter.cc.o.d +800 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/link.txt +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/perf_counters.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/perf_counters.cc.o.d +807 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/progress.make +21 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/reporter.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/reporter.cc.o.d +798 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/statistics.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/statistics.cc.o.d +800 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/string_util.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/string_util.cc.o.d +795 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/sysinfo.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/sysinfo.cc.o.d +933 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/timers.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark.dir/timers.cc.o.d +904 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/DependInfo.cmake +23 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o +0 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o.d +772 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/build.make +114 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/cmake_clean.cmake +11 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/cmake_clean_target.cmake +3 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/compiler_depend.internal +776 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/compiler_depend.make +2317 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/compiler_depend.ts +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/depend.make +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/flags.make +10 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/link.txt +2 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/benchmark_main.dir/progress.make +3 -0
- package/build/_deps/benchmark-build/src/CMakeFiles/progress.marks +1 -0
- package/build/_deps/benchmark-build/src/Makefile +710 -0
- package/build/_deps/benchmark-build/src/cmake_install.cmake +45 -0
- package/build/_deps/benchmark-build/src/libbenchmark.a +0 -0
- package/build/_deps/benchmark-build/src/libbenchmark_main.a +0 -0
- package/build/_deps/benchmark-src/.clang-format +5 -0
- package/build/_deps/benchmark-src/.clang-tidy +7 -0
- package/build/_deps/benchmark-src/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- package/build/_deps/benchmark-src/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/build/_deps/benchmark-src/.github/install_bazel.sh +13 -0
- package/build/_deps/benchmark-src/.github/libcxx-setup.sh +26 -0
- package/build/_deps/benchmark-src/.github/workflows/bazel.yml +35 -0
- package/build/_deps/benchmark-src/.github/workflows/build-and-test-min-cmake.yml +46 -0
- package/build/_deps/benchmark-src/.github/workflows/build-and-test-perfcounters.yml +51 -0
- package/build/_deps/benchmark-src/.github/workflows/build-and-test.yml +114 -0
- package/build/_deps/benchmark-src/.github/workflows/clang-format-lint.yml +17 -0
- package/build/_deps/benchmark-src/.github/workflows/clang-tidy.yml +38 -0
- package/build/_deps/benchmark-src/.github/workflows/doxygen.yml +28 -0
- package/build/_deps/benchmark-src/.github/workflows/pylint.yml +28 -0
- package/build/_deps/benchmark-src/.github/workflows/sanitizer.yml +96 -0
- package/build/_deps/benchmark-src/.github/workflows/test_bindings.yml +29 -0
- package/build/_deps/benchmark-src/.github/workflows/wheels.yml +79 -0
- package/build/_deps/benchmark-src/.travis.yml +208 -0
- package/build/_deps/benchmark-src/.ycm_extra_conf.py +115 -0
- package/build/_deps/benchmark-src/AUTHORS +71 -0
- package/build/_deps/benchmark-src/BUILD.bazel +87 -0
- package/build/_deps/benchmark-src/CMakeLists.txt +340 -0
- package/build/_deps/benchmark-src/CONTRIBUTING.md +58 -0
- package/build/_deps/benchmark-src/CONTRIBUTORS +95 -0
- package/build/_deps/benchmark-src/LICENSE +202 -0
- package/build/_deps/benchmark-src/MODULE.bazel +24 -0
- package/build/_deps/benchmark-src/README.md +223 -0
- package/build/_deps/benchmark-src/WORKSPACE +22 -0
- package/build/_deps/benchmark-src/WORKSPACE.bzlmod +2 -0
- package/build/_deps/benchmark-src/_config.yml +2 -0
- package/build/_deps/benchmark-src/appveyor.yml +50 -0
- package/build/_deps/benchmark-src/bazel/benchmark_deps.bzl +65 -0
- package/build/_deps/benchmark-src/bindings/python/BUILD +3 -0
- package/build/_deps/benchmark-src/bindings/python/build_defs.bzl +25 -0
- package/build/_deps/benchmark-src/bindings/python/google_benchmark/BUILD +40 -0
- package/build/_deps/benchmark-src/bindings/python/google_benchmark/__init__.py +162 -0
- package/build/_deps/benchmark-src/bindings/python/google_benchmark/benchmark.cc +184 -0
- package/build/_deps/benchmark-src/bindings/python/google_benchmark/example.py +136 -0
- package/build/_deps/benchmark-src/bindings/python/nanobind.BUILD +17 -0
- package/build/_deps/benchmark-src/bindings/python/python_headers.BUILD +6 -0
- package/build/_deps/benchmark-src/cmake/AddCXXCompilerFlag.cmake +78 -0
- package/build/_deps/benchmark-src/cmake/CXXFeatureCheck.cmake +82 -0
- package/build/_deps/benchmark-src/cmake/Config.cmake.in +7 -0
- package/build/_deps/benchmark-src/cmake/GetGitVersion.cmake +58 -0
- package/build/_deps/benchmark-src/cmake/GoogleTest.cmake +58 -0
- package/build/_deps/benchmark-src/cmake/GoogleTest.cmake.in +59 -0
- package/build/_deps/benchmark-src/cmake/benchmark.pc.in +12 -0
- package/build/_deps/benchmark-src/cmake/gnu_posix_regex.cpp +12 -0
- package/build/_deps/benchmark-src/cmake/llvm-toolchain.cmake +8 -0
- package/build/_deps/benchmark-src/cmake/posix_regex.cpp +14 -0
- package/build/_deps/benchmark-src/cmake/pthread_affinity.cpp +16 -0
- package/build/_deps/benchmark-src/cmake/split_list.cmake +3 -0
- package/build/_deps/benchmark-src/cmake/std_regex.cpp +10 -0
- package/build/_deps/benchmark-src/cmake/steady_clock.cpp +7 -0
- package/build/_deps/benchmark-src/cmake/thread_safety_attributes.cpp +4 -0
- package/build/_deps/benchmark-src/docs/AssemblyTests.md +149 -0
- package/build/_deps/benchmark-src/docs/_config.yml +3 -0
- package/build/_deps/benchmark-src/docs/assets/images/icon.png +0 -0
- package/build/_deps/benchmark-src/docs/assets/images/icon.xcf +0 -0
- package/build/_deps/benchmark-src/docs/assets/images/icon_black.png +0 -0
- package/build/_deps/benchmark-src/docs/assets/images/icon_black.xcf +0 -0
- package/build/_deps/benchmark-src/docs/dependencies.md +13 -0
- package/build/_deps/benchmark-src/docs/index.md +12 -0
- package/build/_deps/benchmark-src/docs/perf_counters.md +35 -0
- package/build/_deps/benchmark-src/docs/platform_specific_build_instructions.md +48 -0
- package/build/_deps/benchmark-src/docs/python_bindings.md +34 -0
- package/build/_deps/benchmark-src/docs/random_interleaving.md +13 -0
- package/build/_deps/benchmark-src/docs/reducing_variance.md +100 -0
- package/build/_deps/benchmark-src/docs/releasing.md +41 -0
- package/build/_deps/benchmark-src/docs/tools.md +343 -0
- package/build/_deps/benchmark-src/docs/user_guide.md +1266 -0
- package/build/_deps/benchmark-src/include/benchmark/benchmark.h +1991 -0
- package/build/_deps/benchmark-src/include/benchmark/export.h +47 -0
- package/build/_deps/benchmark-src/pyproject.toml +50 -0
- package/build/_deps/benchmark-src/setup.py +113 -0
- package/build/_deps/benchmark-src/src/CMakeLists.txt +170 -0
- package/build/_deps/benchmark-src/src/arraysize.h +33 -0
- package/build/_deps/benchmark-src/src/benchmark.cc +779 -0
- package/build/_deps/benchmark-src/src/benchmark_api_internal.cc +118 -0
- package/build/_deps/benchmark-src/src/benchmark_api_internal.h +87 -0
- package/build/_deps/benchmark-src/src/benchmark_main.cc +18 -0
- package/build/_deps/benchmark-src/src/benchmark_name.cc +59 -0
- package/build/_deps/benchmark-src/src/benchmark_register.cc +520 -0
- package/build/_deps/benchmark-src/src/benchmark_register.h +109 -0
- package/build/_deps/benchmark-src/src/benchmark_runner.cc +497 -0
- package/build/_deps/benchmark-src/src/benchmark_runner.h +131 -0
- package/build/_deps/benchmark-src/src/check.cc +11 -0
- package/build/_deps/benchmark-src/src/check.h +106 -0
- package/build/_deps/benchmark-src/src/colorprint.cc +200 -0
- package/build/_deps/benchmark-src/src/colorprint.h +33 -0
- package/build/_deps/benchmark-src/src/commandlineflags.cc +298 -0
- package/build/_deps/benchmark-src/src/commandlineflags.h +133 -0
- package/build/_deps/benchmark-src/src/complexity.cc +244 -0
- package/build/_deps/benchmark-src/src/complexity.h +55 -0
- package/build/_deps/benchmark-src/src/console_reporter.cc +206 -0
- package/build/_deps/benchmark-src/src/counter.cc +80 -0
- package/build/_deps/benchmark-src/src/counter.h +32 -0
- package/build/_deps/benchmark-src/src/csv_reporter.cc +161 -0
- package/build/_deps/benchmark-src/src/cycleclock.h +230 -0
- package/build/_deps/benchmark-src/src/internal_macros.h +115 -0
- package/build/_deps/benchmark-src/src/json_reporter.cc +320 -0
- package/build/_deps/benchmark-src/src/log.h +88 -0
- package/build/_deps/benchmark-src/src/mutex.h +155 -0
- package/build/_deps/benchmark-src/src/perf_counters.cc +282 -0
- package/build/_deps/benchmark-src/src/perf_counters.h +200 -0
- package/build/_deps/benchmark-src/src/re.h +158 -0
- package/build/_deps/benchmark-src/src/reporter.cc +118 -0
- package/build/_deps/benchmark-src/src/statistics.cc +209 -0
- package/build/_deps/benchmark-src/src/statistics.h +44 -0
- package/build/_deps/benchmark-src/src/string_util.cc +254 -0
- package/build/_deps/benchmark-src/src/string_util.h +70 -0
- package/build/_deps/benchmark-src/src/sysinfo.cc +855 -0
- package/build/_deps/benchmark-src/src/thread_manager.h +63 -0
- package/build/_deps/benchmark-src/src/thread_timer.h +86 -0
- package/build/_deps/benchmark-src/src/timers.cc +272 -0
- package/build/_deps/benchmark-src/src/timers.h +48 -0
- package/build/_deps/benchmark-src/test/AssemblyTests.cmake +67 -0
- package/build/_deps/benchmark-src/test/BUILD +127 -0
- package/build/_deps/benchmark-src/test/CMakeLists.txt +309 -0
- package/build/_deps/benchmark-src/test/args_product_test.cc +77 -0
- package/build/_deps/benchmark-src/test/basic_test.cc +180 -0
- package/build/_deps/benchmark-src/test/benchmark_gtest.cc +169 -0
- package/build/_deps/benchmark-src/test/benchmark_min_time_flag_iters_test.cc +66 -0
- package/build/_deps/benchmark-src/test/benchmark_min_time_flag_time_test.cc +90 -0
- package/build/_deps/benchmark-src/test/benchmark_name_gtest.cc +82 -0
- package/build/_deps/benchmark-src/test/benchmark_random_interleaving_gtest.cc +126 -0
- package/build/_deps/benchmark-src/test/benchmark_setup_teardown_test.cc +157 -0
- package/build/_deps/benchmark-src/test/benchmark_test.cc +274 -0
- package/build/_deps/benchmark-src/test/clobber_memory_assembly_test.cc +64 -0
- package/build/_deps/benchmark-src/test/commandlineflags_gtest.cc +228 -0
- package/build/_deps/benchmark-src/test/complexity_test.cc +228 -0
- package/build/_deps/benchmark-src/test/cxx03_test.cc +62 -0
- package/build/_deps/benchmark-src/test/diagnostics_test.cc +91 -0
- package/build/_deps/benchmark-src/test/display_aggregates_only_test.cc +45 -0
- package/build/_deps/benchmark-src/test/donotoptimize_assembly_test.cc +201 -0
- package/build/_deps/benchmark-src/test/donotoptimize_test.cc +69 -0
- package/build/_deps/benchmark-src/test/filter_test.cc +117 -0
- package/build/_deps/benchmark-src/test/fixture_test.cc +51 -0
- package/build/_deps/benchmark-src/test/internal_threading_test.cc +185 -0
- package/build/_deps/benchmark-src/test/link_main_test.cc +9 -0
- package/build/_deps/benchmark-src/test/map_test.cc +59 -0
- package/build/_deps/benchmark-src/test/memory_manager_test.cc +47 -0
- package/build/_deps/benchmark-src/test/min_time_parse_gtest.cc +30 -0
- package/build/_deps/benchmark-src/test/multiple_ranges_test.cc +96 -0
- package/build/_deps/benchmark-src/test/options_test.cc +77 -0
- package/build/_deps/benchmark-src/test/output_test.h +211 -0
- package/build/_deps/benchmark-src/test/output_test_helper.cc +519 -0
- package/build/_deps/benchmark-src/test/perf_counters_gtest.cc +307 -0
- package/build/_deps/benchmark-src/test/perf_counters_test.cc +92 -0
- package/build/_deps/benchmark-src/test/register_benchmark_test.cc +196 -0
- package/build/_deps/benchmark-src/test/repetitions_test.cc +214 -0
- package/build/_deps/benchmark-src/test/report_aggregates_only_test.cc +41 -0
- package/build/_deps/benchmark-src/test/reporter_output_test.cc +1130 -0
- package/build/_deps/benchmark-src/test/skip_with_error_test.cc +199 -0
- package/build/_deps/benchmark-src/test/spec_arg_test.cc +105 -0
- package/build/_deps/benchmark-src/test/spec_arg_verbosity_test.cc +43 -0
- package/build/_deps/benchmark-src/test/state_assembly_test.cc +68 -0
- package/build/_deps/benchmark-src/test/statistics_gtest.cc +35 -0
- package/build/_deps/benchmark-src/test/string_util_gtest.cc +199 -0
- package/build/_deps/benchmark-src/test/templated_fixture_test.cc +28 -0
- package/build/_deps/benchmark-src/test/time_unit_gtest.cc +37 -0
- package/build/_deps/benchmark-src/test/user_counters_tabular_test.cc +558 -0
- package/build/_deps/benchmark-src/test/user_counters_test.cc +561 -0
- package/build/_deps/benchmark-src/test/user_counters_thousands_test.cc +186 -0
- package/build/_deps/benchmark-src/tools/BUILD.bazel +19 -0
- package/build/_deps/benchmark-src/tools/compare.py +432 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test1_run1.json +127 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test1_run2.json +127 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test2_run.json +81 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test3_run0.json +65 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test3_run1.json +65 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test4_run.json +96 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test4_run0.json +21 -0
- package/build/_deps/benchmark-src/tools/gbench/Inputs/test4_run1.json +21 -0
- package/build/_deps/benchmark-src/tools/gbench/__init__.py +8 -0
- package/build/_deps/benchmark-src/tools/gbench/report.py +1201 -0
- package/build/_deps/benchmark-src/tools/gbench/util.py +203 -0
- package/build/_deps/benchmark-src/tools/libpfm.BUILD.bazel +22 -0
- package/build/_deps/benchmark-src/tools/requirements.txt +2 -0
- package/build/_deps/benchmark-src/tools/strip_asm.py +151 -0
- package/build/_deps/benchmark-subbuild/CMakeCache.txt +133 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/4.0.3/CMakeSystem.cmake +15 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/CMakeConfigureLog.yaml +11 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/CMakeRuleHashes.txt +11 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/InstallScripts.json +7 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/Makefile.cmake +52 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/Makefile2 +122 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/TargetDirectories.txt +3 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/DependInfo.cmake +22 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/Labels.json +46 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/Labels.txt +14 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/build.make +162 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/cmake_clean.cmake +17 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/compiler_depend.make +2 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/compiler_depend.ts +2 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate.dir/progress.make +10 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/cmake.check_cache +1 -0
- package/build/_deps/benchmark-subbuild/CMakeFiles/progress.marks +1 -0
- package/build/_deps/benchmark-subbuild/CMakeLists.txt +42 -0
- package/build/_deps/benchmark-subbuild/Makefile +162 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-gitclone-lastrun.txt +15 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-gitinfo.txt +15 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-patch-info.txt +6 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-update-info.txt +7 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-cfgcmd.txt +1 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-gitclone.cmake +87 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-gitupdate.cmake +317 -0
- package/build/_deps/benchmark-subbuild/benchmark-populate-prefix/tmp/benchmark-populate-mkdirs.cmake +27 -0
- package/build/_deps/benchmark-subbuild/cmake_install.cmake +56 -0
- package/build/bin/avl-rb-range-search-benchmark +0 -0
- package/build/bin/avl-tree-benchmark +0 -0
- package/build/bin/deque-benchmark +0 -0
- package/build/bin/doubly-linked-list-benchmark +0 -0
- package/build/bin/hash-map-benchmark +0 -0
- package/build/bin/heap-benchmark +0 -0
- package/build/bin/priority-queue-benchmark +0 -0
- package/build/bin/queue-benchmark +0 -0
- package/build/bin/red-black-tree-benchmark +0 -0
- package/build/bin/singly-linked-list-benchmark +0 -0
- package/build/bin/stack-benchmark +0 -0
- package/build/bin/tree-map-benchmark +0 -0
- package/build/bin/tree-multi-map-benchmark +0 -0
- package/build/bin/tree-multi-set-benchmark +0 -0
- package/build/bin/tree-set-benchmark +0 -0
- package/build/cmake_install.cmake +66 -0
- package/dist/cjs/index.cjs +1270 -1201
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs-legacy/index.cjs +1309 -1210
- package/dist/cjs-legacy/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1268 -1196
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm-legacy/index.mjs +1307 -1205
- package/dist/esm-legacy/index.mjs.map +1 -1
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +3 -3
- package/dist/types/data-structures/binary-tree/index.d.ts +3 -3
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +177 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +230 -147
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +263 -0
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +170 -0
- package/dist/types/interfaces/binary-tree.d.ts +1 -1
- package/dist/types/types/data-structures/binary-tree/index.d.ts +3 -3
- package/dist/types/types/data-structures/binary-tree/tree-map.d.ts +28 -0
- package/dist/types/types/data-structures/binary-tree/tree-multi-set.d.ts +11 -0
- package/dist/types/types/data-structures/binary-tree/tree-set.d.ts +28 -0
- package/dist/umd/data-structure-typed.js +1303 -1194
- package/dist/umd/data-structure-typed.js.map +1 -1
- package/dist/umd/data-structure-typed.min.js +10 -3
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/eslint.config.mjs +5 -1
- package/package.json +4 -3
- package/src/data-structures/binary-tree/avl-tree.ts +1 -1
- package/src/data-structures/binary-tree/binary-tree.ts +40 -16
- package/src/data-structures/binary-tree/bst.ts +6 -6
- package/src/data-structures/binary-tree/index.ts +3 -3
- package/src/data-structures/binary-tree/red-black-tree.ts +34 -52
- package/src/data-structures/binary-tree/tree-map.ts +417 -0
- package/src/data-structures/binary-tree/tree-multi-map.ts +467 -325
- package/src/data-structures/binary-tree/tree-multi-set.ts +491 -0
- package/src/data-structures/binary-tree/tree-set.ts +394 -0
- package/src/interfaces/binary-tree.ts +1 -1
- package/src/types/data-structures/binary-tree/index.ts +3 -3
- package/src/types/data-structures/binary-tree/tree-map.ts +39 -0
- package/src/types/data-structures/binary-tree/tree-multi-set.ts +13 -0
- package/src/types/data-structures/binary-tree/tree-set.ts +33 -0
- package/test/config.ts +2 -2
- package/test/performance/benchmark-runner-enhanced.mjs +818 -0
- package/test/performance/cmake-benchmark-runner.mjs +234 -0
- package/test/performance/data-structures/binary-tree/avl-rb-range-search.test.cpp +112 -0
- package/test/performance/data-structures/binary-tree/avl-rb-range-search.test.mjs +51 -0
- package/test/performance/data-structures/binary-tree/avl-tree.test.cpp +181 -0
- package/test/performance/data-structures/binary-tree/avl-tree.test.mjs +138 -0
- package/test/performance/data-structures/binary-tree/binary-tree-overall.test.mjs +85 -0
- package/test/performance/data-structures/binary-tree/binary-tree.test.mjs +100 -0
- package/test/performance/data-structures/binary-tree/bst.test.mjs +61 -0
- package/test/performance/data-structures/binary-tree/red-black-tree-cjs.test.mjs +259 -0
- package/test/performance/data-structures/binary-tree/red-black-tree.test.cpp +213 -0
- package/test/performance/data-structures/binary-tree/red-black-tree.test.mjs +275 -0
- package/test/performance/data-structures/binary-tree/tree-map.test.cpp +129 -0
- package/test/performance/data-structures/binary-tree/tree-map.test.mjs +171 -0
- package/test/performance/data-structures/binary-tree/tree-multi-map.test.cpp +205 -0
- package/test/performance/data-structures/binary-tree/tree-multi-map.test.mjs +106 -0
- package/test/performance/data-structures/binary-tree/tree-multi-set.test.cpp +217 -0
- package/test/performance/data-structures/binary-tree/tree-multi-set.test.mjs +91 -0
- package/test/performance/data-structures/binary-tree/tree-set.test.cpp +127 -0
- package/test/performance/data-structures/binary-tree/tree-set.test.mjs +174 -0
- package/test/performance/data-structures/comparison/{comparison.test.ts → comparison.test.mjs} +17 -17
- package/test/performance/data-structures/graph/{directed-graph.test.ts → directed-graph.test.mjs} +4 -4
- package/test/performance/data-structures/hash/hash-map.test.cpp +183 -0
- package/test/performance/data-structures/hash/hash-map.test.mjs +187 -0
- package/test/performance/data-structures/heap/heap.test.cpp +61 -0
- package/test/performance/data-structures/heap/heap.test.mjs +31 -0
- package/test/performance/data-structures/linked-list/doubly-linked-list.test.cpp +84 -0
- package/test/performance/data-structures/linked-list/doubly-linked-list.test.mjs +125 -0
- package/test/performance/data-structures/linked-list/singly-linked-list.test.cpp +77 -0
- package/test/performance/data-structures/linked-list/singly-linked-list.test.mjs +84 -0
- package/test/performance/data-structures/priority-queue/max-priority-queue.test.mjs +40 -0
- package/test/performance/data-structures/priority-queue/priority-queue.test.cpp +59 -0
- package/test/performance/data-structures/priority-queue/priority-queue.test.mjs +64 -0
- package/test/performance/data-structures/queue/deque.test.cpp +119 -0
- package/test/performance/data-structures/queue/deque.test.mjs +144 -0
- package/test/performance/data-structures/queue/queue.test.cpp +59 -0
- package/test/performance/data-structures/queue/queue.test.mjs +77 -0
- package/test/performance/data-structures/stack/stack.test.cpp +40 -0
- package/test/performance/data-structures/stack/stack.test.mjs +69 -0
- package/test/performance/data-structures/trie/trie.test.mjs +43 -0
- package/test/performance/reportor-enhanced.mjs +871 -0
- package/test/performance/runner-config.json +33 -21
- package/test/unit/data-structures/base/iterable-element-base.more-branches.coverage.test.ts +6 -6
- package/test/unit/data-structures/base/linear-base.array.coverage.test.ts +5 -5
- package/test/unit/data-structures/base/linear-base.concat-else.coverage.test.ts +10 -10
- package/test/unit/data-structures/base/linear-base.more-branches.coverage.test.ts +7 -10
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +5 -5
- package/test/unit/data-structures/binary-tree/binary-tree.remaining-branches.coverage.test.ts +7 -4
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +7 -7
- package/test/unit/data-structures/binary-tree/bst.more-branches-3.coverage.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/bst.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/overall.test.ts +18 -31
- package/test/unit/data-structures/binary-tree/red-black-tree.boundary-max-update.coverage.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/red-black-tree.cache-stale-insert.coverage.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/red-black-tree.hint-mapmode-defined.coverage.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/red-black-tree.hint-mapmode-undefined.coverage.test.ts +5 -5
- package/test/unit/data-structures/binary-tree/red-black-tree.hint-more.coverage.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/red-black-tree.remaining-branches.coverage.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/red-black-tree.set-inputs.coverage.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/red-black-tree.setkvnode-parent-cache.coverage.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/red-black-tree.setkvnode-remaining.coverage.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/red-black-tree.setkvnode-uncovered.coverage.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/red-black-tree.update-branches.coverage.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/tree-map.test.ts +270 -0
- package/test/unit/data-structures/binary-tree/tree-multi-map.coverage.test.ts +144 -3
- package/test/unit/data-structures/binary-tree/{tree-multi-map.test.ts → tree-multi-map.legacy.test.ts.skip} +16 -16
- package/test/unit/data-structures/binary-tree/tree-multi-map.rfc.test.ts +99 -0
- package/test/unit/data-structures/binary-tree/tree-multi-map.simplified.test.ts +482 -0
- package/test/unit/data-structures/binary-tree/tree-multi-set.test.ts +545 -0
- package/test/unit/data-structures/binary-tree/tree-set.test.ts +187 -0
- package/test/unit/unrestricted-interconversion.test.ts +12 -10
- package/test/utils/patch.ts +3 -3
- package/test/utils/perf.mjs +34 -0
- package/dist/types/data-structures/binary-tree/avl-tree-counter.d.ts +0 -236
- package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +0 -197
- package/dist/types/data-structures/binary-tree/tree-counter.d.ts +0 -243
- package/dist/types/types/data-structures/binary-tree/avl-tree-counter.d.ts +0 -2
- package/dist/types/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +0 -2
- package/dist/types/types/data-structures/binary-tree/tree-counter.d.ts +0 -2
- package/src/data-structures/binary-tree/avl-tree-counter.ts +0 -539
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +0 -438
- package/src/data-structures/binary-tree/tree-counter.ts +0 -587
- package/src/types/data-structures/binary-tree/avl-tree-counter.ts +0 -3
- package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +0 -3
- package/src/types/data-structures/binary-tree/tree-counter.ts +0 -3
- package/test/performance/benchmark-runner.ts +0 -531
- package/test/performance/data-structures/binary-tree/avl-tree.test.ts +0 -40
- package/test/performance/data-structures/binary-tree/binary-tree-overall.test.ts +0 -37
- package/test/performance/data-structures/binary-tree/binary-tree.test.ts +0 -40
- package/test/performance/data-structures/binary-tree/bst.test.ts +0 -28
- package/test/performance/data-structures/binary-tree/red-black-tree.test.ts +0 -60
- package/test/performance/data-structures/hash/hash-map.test.ts +0 -99
- package/test/performance/data-structures/heap/heap.test.ts +0 -26
- package/test/performance/data-structures/heap/min-heap.test.ts +0 -0
- package/test/performance/data-structures/linked-list/doubly-linked-list.test.ts +0 -59
- package/test/performance/data-structures/linked-list/linked-list.test.ts +0 -0
- package/test/performance/data-structures/linked-list/singly-linked-list.test.ts +0 -35
- package/test/performance/data-structures/linked-list/skip-linked-list.test.ts +0 -0
- package/test/performance/data-structures/linked-list/skip-list.test.ts +0 -0
- package/test/performance/data-structures/matrix/matrix.test.ts +0 -0
- package/test/performance/data-structures/matrix/navigator.test.ts +0 -0
- package/test/performance/data-structures/priority-queue/max-priority-queue.test.ts +0 -17
- package/test/performance/data-structures/priority-queue/min-priority-queue.test.ts +0 -0
- package/test/performance/data-structures/priority-queue/priority-queue.test.ts +0 -34
- package/test/performance/data-structures/queue/deque.test.ts +0 -59
- package/test/performance/data-structures/queue/queue.test.ts +0 -35
- package/test/performance/data-structures/stack/stack.test.ts +0 -37
- package/test/performance/data-structures/trie/trie.test.ts +0 -18
- package/test/performance/reportor.ts +0 -279
- package/test/performance/single-suite-runner.ts +0 -72
- package/test/performance/types/index.ts +0 -1
- package/test/performance/types/reportor.ts +0 -7
- package/test/unit/data-structures/binary-tree/avl-tree-counter.more-branches-3.coverage.test.ts +0 -146
- package/test/unit/data-structures/binary-tree/avl-tree-counter.more-branches.coverage.test.ts +0 -93
- package/test/unit/data-structures/binary-tree/avl-tree-counter.test.ts +0 -878
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.coverage.test.ts +0 -108
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.more-branches-2.coverage.test.ts +0 -85
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +0 -740
- package/test/unit/data-structures/binary-tree/tree-counter.coverage.test.ts +0 -115
- package/test/unit/data-structures/binary-tree/tree-counter.more-branches.coverage.test.ts +0 -244
- package/test/unit/data-structures/binary-tree/tree-counter.test.ts +0 -979
- /package/{test/performance/data-structures/binary-tree/binary-index-tree.test.ts → build/_deps/benchmark-subbuild/CMakeFiles/benchmark-populate-complete} +0 -0
- /package/{test/performance/data-structures/binary-tree/segment-tree.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-build} +0 -0
- /package/{test/performance/data-structures/binary-tree/tree-multimap.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-configure} +0 -0
- /package/{test/performance/data-structures/graph/abstract-graph.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-done} +0 -0
- /package/{test/performance/data-structures/graph/map-graph.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-download} +0 -0
- /package/{test/performance/data-structures/graph/overall.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-install} +0 -0
- /package/{test/performance/data-structures/graph/undirected-graph.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-mkdir} +0 -0
- /package/{test/performance/data-structures/hash/hash-table.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-patch} +0 -0
- /package/{test/performance/data-structures/heap/max-heap.test.ts → build/_deps/benchmark-subbuild/benchmark-populate-prefix/src/benchmark-populate-stamp/benchmark-populate-test} +0 -0
- /package/test/unit/data-structures/binary-tree/{tree-multi-map.more-branches-2.coverage.test.ts → tree-multi-map.more-branches-2.coverage.test.ts.skip} +0 -0
package/test/unit/data-structures/binary-tree/red-black-tree.update-branches.coverage.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RedBlackTree } from '../../../../src';
|
|
2
2
|
|
|
3
3
|
describe('RedBlackTree update-branch coverage', () => {
|
|
4
|
-
it('mapMode: updating existing min/max with undefined value
|
|
4
|
+
it('mapMode: updating existing min/max with undefined value overwrites values (node-index store)', () => {
|
|
5
5
|
const t = new RedBlackTree<number, string>(); // mapMode default
|
|
6
6
|
|
|
7
7
|
t.set(10, 'mid');
|
|
@@ -12,9 +12,9 @@ describe('RedBlackTree update-branch coverage', () => {
|
|
|
12
12
|
t.set(5, undefined as any);
|
|
13
13
|
t.set(15, undefined as any);
|
|
14
14
|
|
|
15
|
-
//
|
|
16
|
-
expect(t.get(5)).toBe(
|
|
17
|
-
expect(t.get(15)).toBe(
|
|
15
|
+
// In node-index mapMode, node.value is the source of truth, so undefined overwrites.
|
|
16
|
+
expect(t.get(5)).toBe(undefined);
|
|
17
|
+
expect(t.get(15)).toBe(undefined);
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
it('set mode: updating an existing interior key uses current.value assignment branch', () => {
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { TreeMap } from '../../../../src';
|
|
2
|
+
|
|
3
|
+
describe('TreeMap (RedBlackTree-backed, no node exposure)', () => {
|
|
4
|
+
test('basic operations: set/get/has/delete/size/isEmpty/clear', () => {
|
|
5
|
+
const m = new TreeMap<number, string>();
|
|
6
|
+
expect(m.isEmpty()).toBe(true);
|
|
7
|
+
expect(m.size).toBe(0);
|
|
8
|
+
|
|
9
|
+
expect(m.set(2, 'b')).toBe(m);
|
|
10
|
+
expect(m.set(1, 'a')).toBe(m);
|
|
11
|
+
expect(m.set(3, 'c')).toBe(m);
|
|
12
|
+
|
|
13
|
+
expect(m.size).toBe(3);
|
|
14
|
+
expect(m.isEmpty()).toBe(false);
|
|
15
|
+
|
|
16
|
+
expect(m.get(2)).toBe('b');
|
|
17
|
+
expect(m.has(2)).toBe(true);
|
|
18
|
+
expect(m.has(999)).toBe(false);
|
|
19
|
+
|
|
20
|
+
expect(m.delete(2)).toBe(true);
|
|
21
|
+
expect(m.delete(2)).toBe(false);
|
|
22
|
+
expect(m.get(2)).toBe(undefined);
|
|
23
|
+
|
|
24
|
+
m.clear();
|
|
25
|
+
expect(m.size).toBe(0);
|
|
26
|
+
expect(m.isEmpty()).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('iteration: keys/values/entries and ordering', () => {
|
|
30
|
+
const m = new TreeMap<number, string>([
|
|
31
|
+
[3, 'c'],
|
|
32
|
+
[1, 'a'],
|
|
33
|
+
[2, 'b']
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
expect([...m.keys()]).toEqual([1, 2, 3]);
|
|
37
|
+
expect([...m.values()]).toEqual(['a', 'b', 'c']);
|
|
38
|
+
expect([...m.entries()]).toEqual<([number, string | undefined])[]>([
|
|
39
|
+
[1, 'a'],
|
|
40
|
+
[2, 'b'],
|
|
41
|
+
[3, 'c']
|
|
42
|
+
]);
|
|
43
|
+
expect([...m]).toEqual<([number, string | undefined])[]>([
|
|
44
|
+
[1, 'a'],
|
|
45
|
+
[2, 'b'],
|
|
46
|
+
[3, 'c']
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
const seen: Array<[number, string | undefined]> = [];
|
|
50
|
+
const ctx = { tag: 'ctx' };
|
|
51
|
+
m.forEach(function (this: typeof ctx, v, k) {
|
|
52
|
+
// verify thisArg binding
|
|
53
|
+
expect(this).toBe(ctx);
|
|
54
|
+
seen.push([k, v]);
|
|
55
|
+
}, ctx);
|
|
56
|
+
expect(seen).toEqual([
|
|
57
|
+
[1, 'a'],
|
|
58
|
+
[2, 'b'],
|
|
59
|
+
[3, 'c']
|
|
60
|
+
]);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('allows undefined values; has() distinguishes missing vs present-undefined', () => {
|
|
64
|
+
const m = new TreeMap<number, undefined>();
|
|
65
|
+
m.set(1, undefined);
|
|
66
|
+
expect(m.has(1)).toBe(true);
|
|
67
|
+
expect(m.get(1)).toBe(undefined);
|
|
68
|
+
expect(m.has(2)).toBe(false);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('constructor throws TypeError for invalid entries (native Map behavior)', () => {
|
|
72
|
+
expect(() => new TreeMap([['a', 1], ['b'] as unknown as [string, number]])).toThrow(TypeError);
|
|
73
|
+
expect(() => new TreeMap([123 as unknown as [string, number]])).toThrow(TypeError);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('constructor throws when encountering invalid keys under default comparator', () => {
|
|
77
|
+
expect(() => new TreeMap<number, number>([[Number.NaN, 1]])).toThrow(TypeError);
|
|
78
|
+
|
|
79
|
+
const bad = new Date('not-a-date');
|
|
80
|
+
expect(() => new TreeMap<Date, number>([[bad, 1]])).toThrow(TypeError);
|
|
81
|
+
|
|
82
|
+
type Obj = { n: number };
|
|
83
|
+
expect(() => new TreeMap<Obj, number>([[{ n: 1 }, 1]])).toThrow(TypeError);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test('default comparator: NaN throws (even on empty tree)', () => {
|
|
87
|
+
const m = new TreeMap<number, number>();
|
|
88
|
+
expect(() => m.set(Number.NaN, 1)).toThrow(TypeError);
|
|
89
|
+
expect(() => m.get(Number.NaN)).toThrow(TypeError);
|
|
90
|
+
expect(() => m.has(Number.NaN)).toThrow(TypeError);
|
|
91
|
+
expect(() => m.delete(Number.NaN)).toThrow(TypeError);
|
|
92
|
+
expect(() => m.ceiling(Number.NaN)).toThrow(TypeError);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test('default comparator: -0 and 0 are the same key', () => {
|
|
96
|
+
const m = new TreeMap<number, string>();
|
|
97
|
+
m.set(-0, 'z');
|
|
98
|
+
expect(m.size).toBe(1);
|
|
99
|
+
expect(m.has(0)).toBe(true);
|
|
100
|
+
expect(m.get(0)).toBe('z');
|
|
101
|
+
|
|
102
|
+
m.set(0, 'zz');
|
|
103
|
+
expect(m.size).toBe(1);
|
|
104
|
+
expect(m.get(-0)).toBe('zz');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test('default comparator: Date supported; invalid Date throws', () => {
|
|
108
|
+
const d1 = new Date('2020-01-01T00:00:00.000Z');
|
|
109
|
+
const d2 = new Date('2021-01-01T00:00:00.000Z');
|
|
110
|
+
|
|
111
|
+
const m = new TreeMap<Date, number>([
|
|
112
|
+
[d2, 2],
|
|
113
|
+
[d1, 1]
|
|
114
|
+
]);
|
|
115
|
+
|
|
116
|
+
expect([...m.keys()]).toEqual([d1, d2]);
|
|
117
|
+
expect(m.first()).toEqual<[Date, number | undefined]>([d1, 1]);
|
|
118
|
+
|
|
119
|
+
const bad = new Date('not-a-date');
|
|
120
|
+
const m2 = new TreeMap<Date, number>();
|
|
121
|
+
expect(() => m2.set(bad, 1)).toThrow(TypeError);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
test('default comparator: string key ordering is supported', () => {
|
|
125
|
+
const m = new TreeMap<string, number>([
|
|
126
|
+
['b', 2],
|
|
127
|
+
['a', 1],
|
|
128
|
+
['c', 3]
|
|
129
|
+
]);
|
|
130
|
+
expect([...m.keys()]).toEqual(['a', 'b', 'c']);
|
|
131
|
+
expect(m.ceiling('bb')).toEqual(['c', 3]);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
test('default comparator: non-primitive/non-Date requires custom comparator', () => {
|
|
135
|
+
type Obj = { n: number };
|
|
136
|
+
const o1: Obj = { n: 1 };
|
|
137
|
+
|
|
138
|
+
expect(() => new TreeMap<Obj, number>([[o1, 1]])).toThrow(TypeError);
|
|
139
|
+
|
|
140
|
+
const byN = (a: Obj, b: Obj) => a.n - b.n;
|
|
141
|
+
const m = new TreeMap<Obj, number>([[o1, 1]], { comparator: byN });
|
|
142
|
+
expect(m.size).toBe(1);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('createDefaultComparator throws for unsupported key types', () => {
|
|
146
|
+
const cmp = TreeMap.createDefaultComparator<object>();
|
|
147
|
+
expect(() => cmp({} as unknown as object, {} as unknown as object)).toThrow(TypeError);
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
test('navigable operations: first/last/pollFirst/pollLast', () => {
|
|
151
|
+
const m = new TreeMap<number, string>();
|
|
152
|
+
expect(m.first()).toBe(undefined);
|
|
153
|
+
expect(m.last()).toBe(undefined);
|
|
154
|
+
expect(m.pollFirst()).toBe(undefined);
|
|
155
|
+
expect(m.pollLast()).toBe(undefined);
|
|
156
|
+
|
|
157
|
+
m.set(2, 'b').set(1, 'a').set(3, 'c');
|
|
158
|
+
expect(m.first()).toEqual([1, 'a']);
|
|
159
|
+
expect(m.last()).toEqual([3, 'c']);
|
|
160
|
+
|
|
161
|
+
expect(m.pollFirst()).toEqual([1, 'a']);
|
|
162
|
+
expect([...m.keys()]).toEqual([2, 3]);
|
|
163
|
+
|
|
164
|
+
expect(m.pollLast()).toEqual([3, 'c']);
|
|
165
|
+
expect([...m.keys()]).toEqual([2]);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
test('navigable operations: ceiling/floor/higher/lower (tuples)', () => {
|
|
169
|
+
const m = new TreeMap<number, string>([
|
|
170
|
+
[1, 'a'],
|
|
171
|
+
[3, 'c'],
|
|
172
|
+
[5, 'e']
|
|
173
|
+
]);
|
|
174
|
+
|
|
175
|
+
expect(m.ceiling(0)).toEqual([1, 'a']);
|
|
176
|
+
expect(m.ceiling(2)).toEqual([3, 'c']);
|
|
177
|
+
expect(m.ceiling(6)).toBe(undefined);
|
|
178
|
+
|
|
179
|
+
expect(m.floor(0)).toBe(undefined);
|
|
180
|
+
expect(m.floor(2)).toEqual([1, 'a']);
|
|
181
|
+
expect(m.floor(6)).toEqual([5, 'e']);
|
|
182
|
+
|
|
183
|
+
expect(m.higher(1)).toEqual([3, 'c']);
|
|
184
|
+
expect(m.higher(5)).toBe(undefined);
|
|
185
|
+
|
|
186
|
+
expect(m.lower(1)).toBe(undefined);
|
|
187
|
+
expect(m.lower(5)).toEqual([3, 'c']);
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
test('rangeSearch supports inclusive/exclusive bounds (tuples)', () => {
|
|
191
|
+
const m = new TreeMap<number, string>([
|
|
192
|
+
[1, 'a'],
|
|
193
|
+
[2, 'b'],
|
|
194
|
+
[3, 'c'],
|
|
195
|
+
[4, 'd'],
|
|
196
|
+
[5, 'e']
|
|
197
|
+
]);
|
|
198
|
+
|
|
199
|
+
expect(m.rangeSearch([2, 4])).toEqual([
|
|
200
|
+
[2, 'b'],
|
|
201
|
+
[3, 'c'],
|
|
202
|
+
[4, 'd']
|
|
203
|
+
]);
|
|
204
|
+
|
|
205
|
+
expect(m.rangeSearch([2, 4], { lowInclusive: true, highInclusive: false })).toEqual([
|
|
206
|
+
[2, 'b'],
|
|
207
|
+
[3, 'c']
|
|
208
|
+
]);
|
|
209
|
+
|
|
210
|
+
expect(m.rangeSearch([2, 4], { lowInclusive: false, highInclusive: true })).toEqual([
|
|
211
|
+
[3, 'c'],
|
|
212
|
+
[4, 'd']
|
|
213
|
+
]);
|
|
214
|
+
|
|
215
|
+
expect(m.rangeSearch([2, 4], { lowInclusive: false, highInclusive: false })).toEqual([[3, 'c']]);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
test('map/filter/reduce/every/some/find/toArray/print', () => {
|
|
219
|
+
const m = new TreeMap<number, string>([
|
|
220
|
+
[3, 'c'],
|
|
221
|
+
[1, 'a'],
|
|
222
|
+
[2, 'b']
|
|
223
|
+
]);
|
|
224
|
+
|
|
225
|
+
expect(m.map((v, k) => [k, `${k}:${v ?? 'u'}`] as [number, string]).toArray()).toEqual<
|
|
226
|
+
([number, string | undefined])[]
|
|
227
|
+
>([
|
|
228
|
+
[1, '1:a'],
|
|
229
|
+
[2, '2:b'],
|
|
230
|
+
[3, '3:c']
|
|
231
|
+
]);
|
|
232
|
+
|
|
233
|
+
const ctx = { prefix: 'x' };
|
|
234
|
+
expect(
|
|
235
|
+
m.map(function (this: typeof ctx, v, k) {
|
|
236
|
+
return [k, `${this.prefix}${k}:${v ?? 'u'}`] as [number, string];
|
|
237
|
+
}, {}, ctx).toArray()
|
|
238
|
+
).toEqual<([number, string | undefined])[]>([
|
|
239
|
+
[1, 'x1:a'],
|
|
240
|
+
[2, 'x2:b'],
|
|
241
|
+
[3, 'x3:c']
|
|
242
|
+
]);
|
|
243
|
+
|
|
244
|
+
expect(m.filter((v, k) => k >= 2).toArray()).toEqual<([number, string | undefined])[]>([
|
|
245
|
+
[2, 'b'],
|
|
246
|
+
[3, 'c']
|
|
247
|
+
]);
|
|
248
|
+
expect(m.reduce((acc, v) => acc + (v ? v.length : 0), 0)).toBe(3);
|
|
249
|
+
|
|
250
|
+
expect(m.every((v, k) => k >= 1 && v !== undefined)).toBe(true);
|
|
251
|
+
expect(m.every((v, k) => k >= 2)).toBe(false);
|
|
252
|
+
|
|
253
|
+
expect(m.some((v, k) => k === 2)).toBe(true);
|
|
254
|
+
expect(m.some((v, k) => k === 999)).toBe(false);
|
|
255
|
+
|
|
256
|
+
expect(m.find((v, k) => k >= 2)).toEqual<[number, string | undefined]>([2, 'b']);
|
|
257
|
+
expect(m.find((v, k) => k >= 999)).toBe(undefined);
|
|
258
|
+
|
|
259
|
+
expect(m.toArray()).toEqual<([number, string | undefined])[]>([
|
|
260
|
+
[1, 'a'],
|
|
261
|
+
[2, 'b'],
|
|
262
|
+
[3, 'c']
|
|
263
|
+
]);
|
|
264
|
+
|
|
265
|
+
const spy = jest.spyOn(console, 'log').mockImplementation(() => undefined);
|
|
266
|
+
m.print();
|
|
267
|
+
expect(spy).toHaveBeenCalled();
|
|
268
|
+
spy.mockRestore();
|
|
269
|
+
});
|
|
270
|
+
});
|
|
@@ -29,11 +29,11 @@ describe('TreeMultiMap coverage', () => {
|
|
|
29
29
|
it('set branches: mapMode true uses _setByNode before _setToValues', () => {
|
|
30
30
|
const tmm = new TreeMultiMap<number, string>();
|
|
31
31
|
|
|
32
|
-
// Create key with
|
|
32
|
+
// Create key with empty bucket via bare key insert
|
|
33
33
|
tmm.set(2 as any);
|
|
34
|
-
expect(tmm.get(2)).
|
|
34
|
+
expect(tmm.get(2)).toEqual([]);
|
|
35
35
|
|
|
36
|
-
// Now set a value: hits existingNode real +
|
|
36
|
+
// Now set a value: hits existingNode real + values append
|
|
37
37
|
tmm.set(2, 'a');
|
|
38
38
|
expect(tmm.get(2)).toEqual(['a']);
|
|
39
39
|
|
|
@@ -101,4 +101,145 @@ describe('TreeMultiMap coverage', () => {
|
|
|
101
101
|
// map returns TreeMultiMap when mapping to array values
|
|
102
102
|
expect((mapped as any).get(2)).toEqual([10, 11]);
|
|
103
103
|
});
|
|
104
|
+
|
|
105
|
+
// ━━━ Additional branch coverage tests ━━━
|
|
106
|
+
|
|
107
|
+
it('set() with null/undefined entry returns false', () => {
|
|
108
|
+
const tmm = new TreeMultiMap<number, string>();
|
|
109
|
+
expect(tmm.set(null as any)).toBe(false);
|
|
110
|
+
expect(tmm.set(undefined as any)).toBe(false);
|
|
111
|
+
expect(tmm.size).toBe(0);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('set([key, bucket], value) uses add() for the value parameter', () => {
|
|
115
|
+
const tmm = new TreeMultiMap<number, string>();
|
|
116
|
+
// Entry array + value param => should add value, ignoring bucket
|
|
117
|
+
tmm.set([1, ['ignored']], 'actual');
|
|
118
|
+
expect(tmm.get(1)).toEqual(['actual']);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('set([key, undefined]) creates empty bucket', () => {
|
|
122
|
+
const tmm = new TreeMultiMap<number, string>();
|
|
123
|
+
tmm.set([1, undefined]);
|
|
124
|
+
expect(tmm.has(1)).toBe(true);
|
|
125
|
+
expect(tmm.get(1)).toEqual([]);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('constructor with null/undefined entries skips them', () => {
|
|
129
|
+
const tmm = new TreeMultiMap<number, string>([
|
|
130
|
+
[1, ['a']],
|
|
131
|
+
null as any,
|
|
132
|
+
undefined as any,
|
|
133
|
+
[2, ['b']]
|
|
134
|
+
]);
|
|
135
|
+
expect(tmm.size).toBe(2);
|
|
136
|
+
expect(tmm.get(1)).toEqual(['a']);
|
|
137
|
+
expect(tmm.get(2)).toEqual(['b']);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('constructor with [null, bucket] entry skips it', () => {
|
|
141
|
+
const tmm = new TreeMultiMap<number, string>([
|
|
142
|
+
[null as any, ['x']],
|
|
143
|
+
[1, ['a']]
|
|
144
|
+
]);
|
|
145
|
+
expect(tmm.size).toBe(1);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('custom comparator skips _validateKey branches', () => {
|
|
149
|
+
const tmm = new TreeMultiMap<{ id: number }, string>([], {
|
|
150
|
+
comparator: (a, b) => a.id - b.id
|
|
151
|
+
});
|
|
152
|
+
// With custom comparator, any key type is allowed (no validation throws)
|
|
153
|
+
const key1 = { id: 1 };
|
|
154
|
+
const key2 = { id: 2 };
|
|
155
|
+
tmm.add(key1, 'a');
|
|
156
|
+
tmm.add(key2, 'b');
|
|
157
|
+
expect(tmm.size).toBe(2);
|
|
158
|
+
// Iteration shows both entries were added
|
|
159
|
+
expect([...tmm.keys()].map(k => k.id)).toEqual([1, 2]);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it('_validateKey throws for invalid types with default comparator', () => {
|
|
163
|
+
const tmm = new TreeMultiMap<any, string>();
|
|
164
|
+
// Object without comparator should throw
|
|
165
|
+
expect(() => tmm.add({ foo: 'bar' }, 'x')).toThrow(TypeError);
|
|
166
|
+
// NaN should throw
|
|
167
|
+
expect(() => tmm.add(NaN, 'x')).toThrow(TypeError);
|
|
168
|
+
// Invalid Date should throw
|
|
169
|
+
expect(() => tmm.add(new Date('invalid'), 'x')).toThrow(TypeError);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('_validateKey accepts string keys', () => {
|
|
173
|
+
const tmm = new TreeMultiMap<string, number>();
|
|
174
|
+
tmm.add('hello', 1);
|
|
175
|
+
tmm.add('world', 2);
|
|
176
|
+
expect(tmm.has('hello')).toBe(true);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it('_validateKey accepts Date keys', () => {
|
|
180
|
+
const tmm = new TreeMultiMap<Date, string>();
|
|
181
|
+
const d1 = new Date('2025-01-01');
|
|
182
|
+
const d2 = new Date('2025-06-01');
|
|
183
|
+
tmm.add(d1, 'new year');
|
|
184
|
+
tmm.add(d2, 'mid year');
|
|
185
|
+
expect(tmm.has(d1)).toBe(true);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('deleteValues returns 0 on non-existent bucket', () => {
|
|
189
|
+
const tmm = new TreeMultiMap<number, string>();
|
|
190
|
+
expect(tmm.deleteValues(999, 'x')).toBe(0);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('deleteValues returns 0 on empty bucket', () => {
|
|
194
|
+
const tmm = new TreeMultiMap<number, string>();
|
|
195
|
+
tmm.set([1, []]);
|
|
196
|
+
expect(tmm.deleteValues(1, 'x')).toBe(0);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it('entriesOf/valuesOf on non-existent key yields nothing', () => {
|
|
200
|
+
const tmm = new TreeMultiMap<number, string>();
|
|
201
|
+
expect([...tmm.entriesOf(999)]).toEqual([]);
|
|
202
|
+
expect([...tmm.valuesOf(999)]).toEqual([]);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it('hasEntry returns false on non-existent bucket', () => {
|
|
206
|
+
const tmm = new TreeMultiMap<number, string>();
|
|
207
|
+
expect(tmm.hasEntry(999, 'x')).toBe(false);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it('navigable methods return undefined on empty map', () => {
|
|
211
|
+
const tmm = new TreeMultiMap<number, string>();
|
|
212
|
+
expect(tmm.first()).toBeUndefined();
|
|
213
|
+
expect(tmm.last()).toBeUndefined();
|
|
214
|
+
expect(tmm.pollFirst()).toBeUndefined();
|
|
215
|
+
expect(tmm.pollLast()).toBeUndefined();
|
|
216
|
+
expect(tmm.ceiling(5)).toBeUndefined();
|
|
217
|
+
expect(tmm.floor(5)).toBeUndefined();
|
|
218
|
+
expect(tmm.higher(5)).toBeUndefined();
|
|
219
|
+
expect(tmm.lower(5)).toBeUndefined();
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it('navigable methods return undefined when key not found', () => {
|
|
223
|
+
const tmm = new TreeMultiMap<number, string>();
|
|
224
|
+
tmm.add(10, 'a');
|
|
225
|
+
tmm.add(20, 'b');
|
|
226
|
+
// ceiling/floor/higher/lower that miss should return undefined
|
|
227
|
+
expect(tmm.ceiling(100)).toBeUndefined();
|
|
228
|
+
expect(tmm.floor(5)).toBeUndefined();
|
|
229
|
+
expect(tmm.higher(20)).toBeUndefined();
|
|
230
|
+
expect(tmm.lower(10)).toBeUndefined();
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it('setMany handles various entry types', () => {
|
|
234
|
+
const tmm = new TreeMultiMap<number, string>();
|
|
235
|
+
const results = tmm.setMany([
|
|
236
|
+
[1, ['a']],
|
|
237
|
+
[2, ['b', 'c']],
|
|
238
|
+
3 as any // key-only
|
|
239
|
+
]);
|
|
240
|
+
expect(results).toEqual([true, true, true]);
|
|
241
|
+
expect(tmm.get(1)).toEqual(['a']);
|
|
242
|
+
expect(tmm.get(2)).toEqual(['b', 'c']);
|
|
243
|
+
expect(tmm.get(3)).toEqual([]);
|
|
244
|
+
});
|
|
104
245
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBinaryTree, Range, TreeMultiMap, TreeMultiMapNode } from '../../../../src';
|
|
1
|
+
import { IBinaryTree, Range, RedBlackTreeNode, TreeMultiMap, TreeMultiMapNode } from '../../../../src';
|
|
2
2
|
import { getRandomInt } from '../../../utils';
|
|
3
3
|
import { isDebugTest } from '../../../config';
|
|
4
4
|
import { costOfLiving } from './data/cost-of-living-by-country';
|
|
@@ -35,9 +35,9 @@ describe('TreeMultiMap 1', () => {
|
|
|
35
35
|
tmm.set(20);
|
|
36
36
|
tmm.set(5);
|
|
37
37
|
|
|
38
|
-
expect(tmm.getNode(10)).toBeInstanceOf(
|
|
39
|
-
expect(tmm.getNode(20)).toBeInstanceOf(
|
|
40
|
-
expect(tmm.getNode(5)).toBeInstanceOf(
|
|
38
|
+
expect(tmm.getNode(10)).toBeInstanceOf(RedBlackTreeNode);
|
|
39
|
+
expect(tmm.getNode(20)).toBeInstanceOf(RedBlackTreeNode);
|
|
40
|
+
expect(tmm.getNode(5)).toBeInstanceOf(RedBlackTreeNode);
|
|
41
41
|
expect(tmm.getNode(15)).toBe(undefined);
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -45,8 +45,8 @@ describe('TreeMultiMap 1', () => {
|
|
|
45
45
|
tmm.set(-10);
|
|
46
46
|
tmm.set(-20);
|
|
47
47
|
|
|
48
|
-
expect(tmm.getNode(-10)).toBeInstanceOf(
|
|
49
|
-
expect(tmm.getNode(-20)).toBeInstanceOf(
|
|
48
|
+
expect(tmm.getNode(-10)).toBeInstanceOf(RedBlackTreeNode);
|
|
49
|
+
expect(tmm.getNode(-20)).toBeInstanceOf(RedBlackTreeNode);
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
|
|
@@ -162,7 +162,7 @@ describe('TreeMultiMap 1', () => {
|
|
|
162
162
|
});
|
|
163
163
|
|
|
164
164
|
it('should the clone method', () => {
|
|
165
|
-
function checkTreeStructure(tmm:
|
|
165
|
+
function checkTreeStructure(tmm: TreeMultiMap<string, number>) {
|
|
166
166
|
expect(tmm.size).toBe(4);
|
|
167
167
|
expect(tmm.root?.key).toBe('2');
|
|
168
168
|
expect(tmm.root?.left?.key).toBe('1');
|
|
@@ -201,19 +201,19 @@ describe('TreeMultiMap 1', () => {
|
|
|
201
201
|
it('should add value', () => {
|
|
202
202
|
const tmm = new TreeMultiMap<number, string>([4, 5, [1, ['1']], 2, 3]);
|
|
203
203
|
expect(tmm.get(1)).toEqual(['1']);
|
|
204
|
-
expect(tmm.getNode(1)?.value).toEqual([]);
|
|
204
|
+
expect(tmm.getNode(1)?.value).toEqual(['1']);
|
|
205
205
|
tmm.set(1, 'a');
|
|
206
206
|
expect(tmm.get(1)).toEqual(['1', 'a']);
|
|
207
207
|
tmm.set([1, ['b']]);
|
|
208
|
-
expect(tmm.getNode(1)?.value).toEqual([]);
|
|
208
|
+
expect(tmm.getNode(1)?.value).toEqual(['1', 'a', 'b']);
|
|
209
209
|
expect(tmm.get(1)).toEqual(['1', 'a', 'b']);
|
|
210
210
|
const tmmMapped = new TreeMultiMap<number>([4, 5, [1, ['1']], 2, 3]);
|
|
211
211
|
expect(tmmMapped.get(1)).toEqual(['1']);
|
|
212
|
-
expect(tmmMapped.getNode(1)?.value).toEqual([]);
|
|
212
|
+
expect(tmmMapped.getNode(1)?.value).toEqual(['1']);
|
|
213
213
|
tmmMapped.set(1, 'a');
|
|
214
214
|
expect(tmmMapped.get(1)).toEqual(['1', 'a']);
|
|
215
215
|
tmmMapped.set([1, ['b']]);
|
|
216
|
-
expect(tmmMapped.getNode(1)?.value).toEqual([]);
|
|
216
|
+
expect(tmmMapped.getNode(1)?.value).toEqual(['1', 'a', 'b']);
|
|
217
217
|
expect(tmmMapped.get(1)).toEqual(['1', 'a', 'b']);
|
|
218
218
|
});
|
|
219
219
|
});
|
|
@@ -585,7 +585,7 @@ describe('TreeMultiMap 2', () => {
|
|
|
585
585
|
}
|
|
586
586
|
|
|
587
587
|
let nanCount = 0;
|
|
588
|
-
const dfs = (cur:
|
|
588
|
+
const dfs = (cur: RedBlackTreeNode<number, number[]>) => {
|
|
589
589
|
if (isNaN(cur.key)) nanCount++;
|
|
590
590
|
if (cur.left) dfs(cur.left);
|
|
591
591
|
if (cur.right) dfs(cur.right);
|
|
@@ -610,7 +610,7 @@ describe('TreeMultiMap 2', () => {
|
|
|
610
610
|
}
|
|
611
611
|
|
|
612
612
|
let nanCount = 0;
|
|
613
|
-
const dfs = (cur:
|
|
613
|
+
const dfs = (cur: RedBlackTreeNode<number, number[]>) => {
|
|
614
614
|
if (isNaN(cur.key)) nanCount++;
|
|
615
615
|
if (cur.left) dfs(cur.left);
|
|
616
616
|
if (cur.right) dfs(cur.right);
|
|
@@ -638,7 +638,7 @@ describe('TreeMultiMap 2', () => {
|
|
|
638
638
|
const node3 = tmm.getNode(3);
|
|
639
639
|
// expect(node3).toBeInstanceOf(BinaryTreeNode);
|
|
640
640
|
// expect(node3).toBeInstanceOf(BSTNode);
|
|
641
|
-
expect(node3).toBeInstanceOf(
|
|
641
|
+
expect(node3).toBeInstanceOf(RedBlackTreeNode);
|
|
642
642
|
});
|
|
643
643
|
|
|
644
644
|
it('forEach should iterate over all elements', () => {
|
|
@@ -663,7 +663,7 @@ describe('TreeMultiMap 2', () => {
|
|
|
663
663
|
});
|
|
664
664
|
|
|
665
665
|
it('map should return a new tmm with modified elements', () => {
|
|
666
|
-
const tmmMapped = tmm.map((value, key) => [(key * 2).toString(), value ? value : []]);
|
|
666
|
+
const tmmMapped = tmm.map((value, key) => [(key * 2).toString(), value ? value : []] as any);
|
|
667
667
|
expect(tmmMapped.size).toBe(3);
|
|
668
668
|
expect([...tmmMapped]).toEqual([
|
|
669
669
|
['2', ['a']],
|
|
@@ -963,7 +963,7 @@ describe('classic use', () => {
|
|
|
963
963
|
isMapMode: false
|
|
964
964
|
});
|
|
965
965
|
|
|
966
|
-
const topPlayersEquipments = playerRankings.rangeSearch([8900, 10000], node => playerRankings.get(node));
|
|
966
|
+
const topPlayersEquipments = playerRankings.rangeSearch([8900, 10000], node => playerRankings.get(node.key));
|
|
967
967
|
expect(topPlayersEquipments).toEqual([
|
|
968
968
|
[
|
|
969
969
|
{
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { TreeMultiMap } from '../../../../src';
|
|
2
|
+
|
|
3
|
+
describe('TreeMultiMap (RFC additions)', () => {
|
|
4
|
+
it('get() returns a live bucket reference (mutating it mutates the container); empty bucket does not auto-delete key', () => {
|
|
5
|
+
const mm = new TreeMultiMap<number, string>();
|
|
6
|
+
mm.set(1, 'a');
|
|
7
|
+
mm.set(1, 'b');
|
|
8
|
+
|
|
9
|
+
const bucket = mm.get(1)!;
|
|
10
|
+
expect(bucket).toEqual(['a', 'b']);
|
|
11
|
+
|
|
12
|
+
bucket.push('c');
|
|
13
|
+
expect(mm.get(1)).toEqual(['a', 'b', 'c']);
|
|
14
|
+
|
|
15
|
+
// If bucket is emptied by mutation, key remains until delete(key) is called.
|
|
16
|
+
bucket.length = 0;
|
|
17
|
+
expect(mm.has(1)).toBe(true);
|
|
18
|
+
expect(mm.get(1)).toEqual([]);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('totalSize is the sum of bucket lengths across all keys', () => {
|
|
22
|
+
const mm = new TreeMultiMap<number, string>();
|
|
23
|
+
mm.set(1, 'a');
|
|
24
|
+
mm.set(1, 'b');
|
|
25
|
+
mm.set(2, 'x');
|
|
26
|
+
expect(mm.totalSize).toBe(3);
|
|
27
|
+
|
|
28
|
+
// live bucket mutation reflected
|
|
29
|
+
mm.get(2)!.push('y', 'z');
|
|
30
|
+
expect(mm.totalSize).toBe(5);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('hasEntry/deleteValue/deleteValues default Object.is and optional eq', () => {
|
|
34
|
+
const mm = new TreeMultiMap<number, { id: number }>();
|
|
35
|
+
const a1 = { id: 1 };
|
|
36
|
+
const a1b = { id: 1 };
|
|
37
|
+
|
|
38
|
+
mm.set(1, a1);
|
|
39
|
+
mm.set(1, a1b);
|
|
40
|
+
|
|
41
|
+
// Object.is uses reference equality for objects
|
|
42
|
+
expect(mm.hasEntry(1, { id: 1 })).toBe(false);
|
|
43
|
+
expect(mm.hasEntry(1, a1)).toBe(true);
|
|
44
|
+
|
|
45
|
+
const eq = (x: { id: number }, y: { id: number }) => x.id === y.id;
|
|
46
|
+
expect(mm.hasEntry(1, { id: 1 }, eq)).toBe(true);
|
|
47
|
+
|
|
48
|
+
// deleteValue deletes one match
|
|
49
|
+
expect(mm.deleteValue(1, { id: 1 }, eq)).toBe(true);
|
|
50
|
+
expect(mm.get(1)!.length).toBe(1);
|
|
51
|
+
|
|
52
|
+
// deleteValues deletes all matches
|
|
53
|
+
mm.set(1, { id: 1 });
|
|
54
|
+
mm.set(1, { id: 2 });
|
|
55
|
+
expect(mm.deleteValues(1, { id: 1 }, eq)).toBe(2);
|
|
56
|
+
expect(mm.get(1)).toEqual([{ id: 2 }]);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('navigable methods return entry tuples [K, V[]]; pollFirst/pollLast delete whole buckets', () => {
|
|
60
|
+
const mm = new TreeMultiMap<number, string>();
|
|
61
|
+
mm.set(2, 'b');
|
|
62
|
+
mm.set(1, 'a');
|
|
63
|
+
mm.set(3, 'c');
|
|
64
|
+
|
|
65
|
+
expect(mm.first()).toEqual([1, ['a']]);
|
|
66
|
+
expect(mm.last()).toEqual([3, ['c']]);
|
|
67
|
+
expect(mm.ceiling(2)).toEqual([2, ['b']]);
|
|
68
|
+
expect(mm.floor(2)).toEqual([2, ['b']]);
|
|
69
|
+
expect(mm.higher(2)).toEqual([3, ['c']]);
|
|
70
|
+
expect(mm.lower(2)).toEqual([1, ['a']]);
|
|
71
|
+
|
|
72
|
+
const pf = mm.pollFirst();
|
|
73
|
+
expect(pf).toEqual([1, ['a']]);
|
|
74
|
+
expect(mm.has(1)).toBe(false);
|
|
75
|
+
|
|
76
|
+
const pl = mm.pollLast();
|
|
77
|
+
expect(pl).toEqual([3, ['c']]);
|
|
78
|
+
expect(mm.has(3)).toBe(false);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('flatEntries()/entriesOf()/valuesOf() provide entry-flat views', () => {
|
|
82
|
+
const mm = new TreeMultiMap<number, string>();
|
|
83
|
+
mm.set(1, 'a');
|
|
84
|
+
mm.set(1, 'b');
|
|
85
|
+
mm.set(2, 'x');
|
|
86
|
+
|
|
87
|
+
expect([...mm.entriesOf(1)]).toEqual([
|
|
88
|
+
[1, 'a'],
|
|
89
|
+
[1, 'b']
|
|
90
|
+
]);
|
|
91
|
+
expect([...mm.valuesOf(1)]).toEqual(['a', 'b']);
|
|
92
|
+
|
|
93
|
+
expect([...mm.flatEntries()]).toEqual([
|
|
94
|
+
[1, 'a'],
|
|
95
|
+
[1, 'b'],
|
|
96
|
+
[2, 'x']
|
|
97
|
+
]);
|
|
98
|
+
});
|
|
99
|
+
});
|