1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-28 08:50:30 +02:00
This commit is contained in:
Justin Lin
2021-02-08 10:02:28 +08:00
parent d26d4dfabd
commit e96439cfa8
2 changed files with 20 additions and 0 deletions

19
test/util/test_dedup.scad Normal file
View File

@@ -0,0 +1,19 @@
use <util/dedup.scad>;
use <util/sort.scad>;
module test_dedup() {
echo("==== test_dedup ====");
points = [[1, 1, 2], [3, 4, 2], [7, 2, 2], [3, 4, 2], [1, 2, 3]];
assert(
dedup([[1, 1, 2], [3, 4, 2], [7, 2, 2], [3, 4, 2], [1, 2, 3]])
== [[1, 1, 2], [3, 4, 2], [7, 2, 2], [1, 2, 3]]
);
assert(
dedup(sort([[1, 1, 2], [3, 4, 2], [7, 2, 2], [3, 4, 2], [1, 2, 3]]), sorted = true)
== [[1, 1, 2], [1, 2, 3], [3, 4, 2], [7, 2, 2]]
);
}
test_dedup();