1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-27 00:17:27 +02:00
This commit is contained in:
Justin Lin
2021-03-05 07:54:48 +08:00
parent f82cd92d9e
commit 6516f7206c
2 changed files with 19 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
use <unittest.scad>;
use <collection/hashset.scad>;
module test_hashset() {
echo("==== test_hashset ====");
s = hashset([1, 2, 3, 4, 5, 2, 3, 5]);
assert(hashset_list(s) == [1, 2, 3, 4, 5]);
s2 = hashset_add(s, 9);
assert(hashset_list(s2) == [1, 2, 3, 4, 5, 9]);
assert(!hashset_has(s2, 13));
assert(hashset_list(hashset_del(s2, 2)) == [1, 3, 4, 5, 9]);
}
test_hashset();