mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-07 07:16:36 +02:00
rename
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
function hashset_list(set) = [
|
function hashset_elems(set) = [
|
||||||
for(bucket = set)
|
for(bucket = set)
|
||||||
for(elem = bucket)
|
for(elem = bucket)
|
||||||
elem
|
elem
|
@@ -1,5 +1,5 @@
|
|||||||
use <util/set/hashset.scad>;
|
use <util/set/hashset.scad>;
|
||||||
use <util/set/hashset_list.scad>;
|
use <util/set/hashset_elems.scad>;
|
||||||
use <util/set/hashset_add.scad>;
|
use <util/set/hashset_add.scad>;
|
||||||
use <util/set/hashset_del.scad>;
|
use <util/set/hashset_del.scad>;
|
||||||
use <util/set/hashset_has.scad>;
|
use <util/set/hashset_has.scad>;
|
||||||
@@ -9,15 +9,15 @@ module test_hashset() {
|
|||||||
echo("==== test_hashset ====");
|
echo("==== test_hashset ====");
|
||||||
|
|
||||||
s = hashset([1, 2, 3, 4, 5, 2, 3, 5]);
|
s = hashset([1, 2, 3, 4, 5, 2, 3, 5]);
|
||||||
assert(hashset_list(s) == [1, 2, 3, 4, 5]);
|
assert(hashset_elems(s) == [1, 2, 3, 4, 5]);
|
||||||
assert(hashset_len(s) == 5);
|
assert(hashset_len(s) == 5);
|
||||||
|
|
||||||
s2 = hashset_add(s, 9);
|
s2 = hashset_add(s, 9);
|
||||||
assert(hashset_list(s2) == [1, 2, 3, 4, 5, 9]);
|
assert(hashset_elems(s2) == [1, 2, 3, 4, 5, 9]);
|
||||||
|
|
||||||
assert(!hashset_has(s2, 13));
|
assert(!hashset_has(s2, 13));
|
||||||
|
|
||||||
assert(hashset_list(hashset_del(s2, 2)) == [1, 3, 4, 5, 9]);
|
assert(hashset_elems(hashset_del(s2, 2)) == [1, 3, 4, 5, 9]);
|
||||||
}
|
}
|
||||||
|
|
||||||
test_hashset();
|
test_hashset();
|
Reference in New Issue
Block a user