mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-01-29 11:58:39 +01:00
refactor unittest
This commit is contained in:
parent
e1774765de
commit
b7ad7ea46e
@ -1,13 +1,12 @@
|
||||
include <unittest.scad>;
|
||||
include <matrix/m_rotation.scad>;
|
||||
include <matrix/m_scaling.scad>;
|
||||
include <matrix/m_translation.scad>;
|
||||
include <matrix/m_cumulate.scad>;
|
||||
|
||||
module test_m_cumulate() {
|
||||
echo("==== test_m_cumulate ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <matrix/m_rotation.scad>;
|
||||
include <matrix/m_scaling.scad>;
|
||||
include <matrix/m_translation.scad>;
|
||||
include <matrix/m_cumulate.scad>;
|
||||
|
||||
expected = [[1, -1.73205, 0, 10], [1.73205, 1, 0, 20], [0, 0, 2, 10], [0, 0, 0, 1]];
|
||||
actual = m_cumulate([
|
||||
m_translation([10, 20, 10]), m_scaling(2), m_rotation(60)]
|
||||
|
@ -1,9 +1,9 @@
|
||||
include <unittest.scad>;
|
||||
include <pixel/px_circle.scad>;
|
||||
|
||||
module test_px_circle() {
|
||||
echo("==== test_px_circle ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <pixel/px_circle.scad>;
|
||||
expected = [[0, 10], [0, -10], [-10, 0], [-9, 0], [-8, 0], [-7, 0], [-6, 0], [-5, 0], [-4, 0], [-3, 0], [-2, 0], [-1, 0], [0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0], [9, 0], [10, 0], [-1, -10], [0, -10], [1, -10], [-10, -1], [-9, -1], [-8, -1], [-7, -1], [-6, -1], [-5, -1], [-4, -1], [-3, -1], [-2, -1], [-1, -1], [0, -1], [1, -1], [2, -1], [3, -1], [4, -1], [5, -1], [6, -1], [7, -1], [8, -1], [9, -1], [10, -1], [-10, 1], [-9, 1], [-8, 1], [-7, 1], [-6, 1], [-5, 1], [-4, 1], [-3, 1], [-2, 1], [-1, 1], [0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [9, 1], [10, 1], [-1, 10], [0, 10], [1, 10], [-2, -10], [-1, -10], [0, -10], [1, -10], [2, -10], [-10, -2], [-9, -2], [-8, -2], [-7, -2], [-6, -2], [-5, -2], [-4, -2], [-3, -2], [-2, -2], [-1, -2], [0, -2], [1, -2], [2, -2], [3, -2], [4, -2], [5, -2], [6, -2], [7, -2], [8, -2], [9, -2], [10, -2], [-10, 2], [-9, 2], [-8, 2], [-7, 2], [-6, 2], [-5, 2], [-4, 2], [-3, 2], [-2, 2], [-1, 2], [0, 2], [1, 2], [2, 2], [3, 2], [4, 2], [5, 2], [6, 2], [7, 2], [8, 2], [9, 2], [10, 2], [-2, 10], [-1, 10], [0, 10], [1, 10], [2, 10], [-3, -10], [-2, -10], [-1, -10], [0, -10], [1, -10], [2, -10], [3, -10], [-10, -3], [-9, -3], [-8, -3], [-7, -3], [-6, -3], [-5, -3], [-4, -3], [-3, -3], [-2, -3], [-1, -3], [0, -3], [1, -3], [2, -3], [3, -3], [4, -3], [5, -3], [6, -3], [7, -3], [8, -3], [9, -3], [10, -3], [-10, 3], [-9, 3], [-8, 3], [-7, 3], [-6, 3], [-5, 3], [-4, 3], [-3, 3], [-2, 3], [-1, 3], [0, 3], [1, 3], [2, 3], [3, 3], [4, 3], [5, 3], [6, 3], [7, 3], [8, 3], [9, 3], [10, 3], [-3, 10], [-2, 10], [-1, 10], [0, 10], [1, 10], [2, 10], [3, 10], [-4, -9], [-3, -9], [-2, -9], [-1, -9], [0, -9], [1, -9], [2, -9], [3, -9], [4, -9], [-9, -4], [-8, -4], [-7, -4], [-6, -4], [-5, -4], [-4, -4], [-3, -4], [-2, -4], [-1, -4], [0, -4], [1, -4], [2, -4], [3, -4], [4, -4], [5, -4], [6, -4], [7, -4], [8, -4], [9, -4], [-9, 4], [-8, 4], [-7, 4], [-6, 4], [-5, 4], [-4, 4], [-3, 4], [-2, 4], [-1, 4], [0, 4], [1, 4], [2, 4], [3, 4], [4, 4], [5, 4], [6, 4], [7, 4], [8, 4], [9, 4], [-4, 9], [-3, 9], [-2, 9], [-1, 9], [0, 9], [1, 9], [2, 9], [3, 9], [4, 9], [-5, -9], [-4, -9], [-3, -9], [-2, -9], [-1, -9], [0, -9], [1, -9], [2, -9], [3, -9], [4, -9], [5, -9], [-9, -5], [-8, -5], [-7, -5], [-6, -5], [-5, -5], [-4, -5], [-3, -5], [-2, -5], [-1, -5], [0, -5], [1, -5], [2, -5], [3, -5], [4, -5], [5, -5], [6, -5], [7, -5], [8, -5], [9, -5], [-9, 5], [-8, 5], [-7, 5], [-6, 5], [-5, 5], [-4, 5], [-3, 5], [-2, 5], [-1, 5], [0, 5], [1, 5], [2, 5], [3, 5], [4, 5], [5, 5], [6, 5], [7, 5], [8, 5], [9, 5], [-5, 9], [-4, 9], [-3, 9], [-2, 9], [-1, 9], [0, 9], [1, 9], [2, 9], [3, 9], [4, 9], [5, 9], [-6, -8], [-5, -8], [-4, -8], [-3, -8], [-2, -8], [-1, -8], [0, -8], [1, -8], [2, -8], [3, -8], [4, -8], [5, -8], [6, -8], [-8, -6], [-7, -6], [-6, -6], [-5, -6], [-4, -6], [-3, -6], [-2, -6], [-1, -6], [0, -6], [1, -6], [2, -6], [3, -6], [4, -6], [5, -6], [6, -6], [7, -6], [8, -6], [-8, 6], [-7, 6], [-6, 6], [-5, 6], [-4, 6], [-3, 6], [-2, 6], [-1, 6], [0, 6], [1, 6], [2, 6], [3, 6], [4, 6], [5, 6], [6, 6], [7, 6], [8, 6], [-6, 8], [-5, 8], [-4, 8], [-3, 8], [-2, 8], [-1, 8], [0, 8], [1, 8], [2, 8], [3, 8], [4, 8], [5, 8], [6, 8], [-7, -7], [-6, -7], [-5, -7], [-4, -7], [-3, -7], [-2, -7], [-1, -7], [0, -7], [1, -7], [2, -7], [3, -7], [4, -7], [5, -7], [6, -7], [7, -7], [-7, -7], [-6, -7], [-5, -7], [-4, -7], [-3, -7], [-2, -7], [-1, -7], [0, -7], [1, -7], [2, -7], [3, -7], [4, -7], [5, -7], [6, -7], [7, -7], [-7, 7], [-6, 7], [-5, 7], [-4, 7], [-3, 7], [-2, 7], [-1, 7], [0, 7], [1, 7], [2, 7], [3, 7], [4, 7], [5, 7], [6, 7], [7, 7], [-7, 7], [-6, 7], [-5, 7], [-4, 7], [-3, 7], [-2, 7], [-1, 7], [0, 7], [1, 7], [2, 7], [3, 7], [4, 7], [5, 7], [6, 7], [7, 7]];
|
||||
actual = px_circle(10, true);
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
include <unittest.scad>;
|
||||
include <pixel/px_cylinder.scad>;
|
||||
|
||||
module test_px_cylinder() {
|
||||
echo("==== test_px_cylinder ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <pixel/px_cylinder.scad>;
|
||||
|
||||
r1 = 10;
|
||||
r2 = 5;
|
||||
h = 3;
|
||||
|
@ -1,9 +1,9 @@
|
||||
include <unittest.scad>;
|
||||
include <pixel/px_line.scad>;
|
||||
|
||||
module test_px_line() {
|
||||
echo("==== test_px_line ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <pixel/px_line.scad>;
|
||||
expected = [[-10, 0, -10], [-9, 1, -10], [-9, 2, -9], [-8, 3, -9], [-8, 4, -8], [-7, 5, -8], [-6, 6, -8], [-6, 7, -7], [-5, 8, -7], [-5, 9, -6], [-4, 10, -6], [-3, 11, -6], [-3, 12, -5], [-2, 13, -5], [-2, 14, -4], [-1, 15, -4], [0, 16, -4], [0, 17, -3], [1, 18, -3], [1, 19, -2], [2, 20, -2], [3, 21, -2], [3, 22, -1], [4, 23, -1], [4, 24, 0], [5, 25, 0], [6, 26, 0], [6, 27, 1], [7, 28, 1], [7, 29, 2], [8, 30, 2], [9, 31, 2], [9, 32, 3], [10, 33, 3], [10, 34, 4], [11, 35, 4], [12, 36, 4], [12, 37, 5], [13, 38, 5], [13, 39, 6], [14, 40, 6], [15, 41, 6], [15, 42, 7], [16, 43, 7], [16, 44, 8], [17, 45, 8], [18, 46, 8], [18, 47, 9], [19, 48, 9], [19, 49, 10]];
|
||||
actual = px_line([-10, 0, -10], [20, 50, 10]);
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
include <unittest.scad>;
|
||||
include <in_shape.scad>;
|
||||
include <pixel/px_line.scad>;
|
||||
include <pixel/px_polyline.scad>;
|
||||
include <pixel/px_polygon.scad>;
|
||||
|
||||
module test_px_polygon() {
|
||||
echo("==== test_px_polygon ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <in_shape.scad>;
|
||||
include <pixel/px_line.scad>;
|
||||
include <pixel/px_polyline.scad>;
|
||||
include <pixel/px_polygon.scad>;
|
||||
|
||||
expected = [[5, 10], [4, 10], [3, 9], [2, 9], [1, 9], [0, 8], [-1, 8], [-2, 8], [-3, 7], [-4, 7], [-5, 7], [-6, 6], [-7, 6], [-8, 6], [-9, 5], [-10, 5], [-10, 4], [-9, 3], [-9, 2], [-9, 1], [-8, 0], [-8, -1], [-8, -2], [-7, -3], [-7, -4], [-7, -5], [-6, -6], [-6, -7], [-6, -8], [-5, -9], [-5, -10], [-5, -10], [-4, -9], [-4, -8], [-3, -7], [-3, -6], [-2, -5], [-2, -4], [-1, -3], [-1, -2], [0, -1], [0, 0], [1, 1], [1, 2], [2, 3], [2, 4], [3, 5], [3, 6], [4, 7], [4, 8], [5, 9]];
|
||||
actual = px_polygon([[5, 10], [-10, 5], [-5, -10]], false);
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
include <unittest.scad>;
|
||||
include <pixel/px_line.scad>;
|
||||
include <pixel/px_polyline.scad>;
|
||||
|
||||
module test_px_polyline() {
|
||||
echo("==== test_px_polyline ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <pixel/px_line.scad>;
|
||||
include <pixel/px_polyline.scad>;
|
||||
expected = [[5, 10, 5], [4, 9, 5], [3, 8, 5], [2, 7, 6], [1, 6, 6], [0, 5, 6], [-1, 4, 6], [-2, 3, 6], [-3, 2, 6], [-4, 1, 7], [-5, 0, 7], [-6, -1, 7], [-7, -2, 7], [-8, -3, 7], [-9, -4, 7], [-10, -5, 8], [-11, -6, 8], [-12, -7, 8], [-13, -8, 8], [-14, -9, 8], [-15, -10, 8], [-16, -11, 9], [-17, -12, 9], [-18, -13, 9], [-19, -14, 9], [-20, -15, 9], [-21, -16, 9], [-22, -17, 10], [-23, -18, 10], [-24, -19, 10], [-25, -20, 10], [-25, -19, 10], [-25, -18, 10], [-25, -17, 10], [-25, -16, 11], [-25, -15, 11], [-25, -14, 11], [-25, -13, 11], [-25, -12, 11], [-25, -11, 11], [-25, -10, 11], [-25, -9, 12], [-25, -8, 12], [-25, -7, 12], [-25, -6, 12], [-25, -5, 12], [-25, -4, 12], [-25, -3, 12], [-25, -2, 13], [-25, -1, 13], [-25, 0, 13], [-25, 1, 13], [-25, 2, 13], [-25, 3, 13], [-25, 4, 13], [-25, 5, 14], [-25, 6, 14], [-25, 7, 14], [-25, 8, 14], [-25, 9, 14], [-25, 10, 14], [-25, 11, 14], [-25, 12, 15], [-25, 13, 15], [-25, 14, 15], [-25, 15, 15], [-24, 15, 15], [-23, 15, 15], [-22, 16, 15], [-21, 16, 15], [-20, 16, 16], [-19, 16, 16], [-18, 16, 16], [-17, 17, 16], [-16, 17, 16], [-15, 17, 16], [-14, 17, 16], [-13, 17, 16], [-12, 18, 16], [-11, 18, 16], [-10, 18, 17], [-9, 18, 17], [-8, 18, 17], [-7, 19, 17], [-6, 19, 17], [-5, 19, 17], [-4, 19, 17], [-3, 19, 17], [-2, 20, 17], [-1, 20, 17], [0, 20, 18], [1, 20, 18], [2, 20, 18], [3, 21, 18], [4, 21, 18], [5, 21, 18], [6, 21, 18], [7, 21, 18], [8, 22, 18], [9, 22, 18], [10, 22, 19], [11, 22, 19], [12, 22, 19], [13, 23, 19], [14, 23, 19], [15, 23, 19], [16, 23, 19], [17, 23, 19], [18, 24, 19], [19, 24, 19], [20, 24, 20], [21, 24, 20], [22, 24, 20], [23, 25, 20], [24, 25, 20]];
|
||||
actual = px_polyline([[5, 10, 5], [-25, -20, 10], [-25, 15, 15], [25, 25, 20]]);
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
include <unittest.scad>;
|
||||
include <pixel/px_sphere.scad>;
|
||||
|
||||
module test_px_sphere() {
|
||||
echo("==== test_px_sphere ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <pixel/px_sphere.scad>;
|
||||
expected = [[-2, -2, -4], [-1, -2, -4], [0, -2, -4], [1, -2, -4], [2, -2, -4], [-2, -1, -4], [-1, -1, -4], [0, -1, -4], [1, -1, -4], [2, -1, -4], [-2, 0, -4], [-1, 0, -4], [0, 0, -4], [1, 0, -4], [2, 0, -4], [-2, 1, -4], [-1, 1, -4], [0, 1, -4], [1, 1, -4], [2, 1, -4], [-2, 2, -4], [-1, 2, -4], [0, 2, -4], [1, 2, -4], [2, 2, -4], [-2, -3, -3], [-1, -3, -3], [0, -3, -3], [1, -3, -3], [2, -3, -3], [-3, -2, -3], [-2, -2, -3], [2, -2, -3], [3, -2, -3], [-3, -1, -3], [3, -1, -3], [-3, 0, -3], [3, 0, -3], [-3, 1, -3], [3, 1, -3], [-3, 2, -3], [-2, 2, -3], [2, 2, -3], [3, 2, -3], [-2, 3, -3], [-1, 3, -3], [0, 3, -3], [1, 3, -3], [2, 3, -3], [-2, -4, -2], [-1, -4, -2], [0, -4, -2], [1, -4, -2], [2, -4, -2], [-3, -3, -2], [-2, -3, -2], [2, -3, -2], [3, -3, -2], [-4, -2, -2], [-3, -2, -2], [3, -2, -2], [4, -2, -2], [-4, -1, -2], [4, -1, -2], [-4, 0, -2], [4, 0, -2], [-4, 1, -2], [4, 1, -2], [-4, 2, -2], [-3, 2, -2], [3, 2, -2], [4, 2, -2], [-3, 3, -2], [-2, 3, -2], [2, 3, -2], [3, 3, -2], [-2, 4, -2], [-1, 4, -2], [0, 4, -2], [1, 4, -2], [2, 4, -2], [-2, -4, -1], [-1, -4, -1], [0, -4, -1], [1, -4, -1], [2, -4, -1], [-3, -3, -1], [3, -3, -1], [-4, -2, -1], [4, -2, -1], [-4, -1, -1], [4, -1, -1], [-4, 0, -1], [4, 0, -1], [-4, 1, -1], [4, 1, -1], [-4, 2, -1], [4, 2, -1], [-3, 3, -1], [3, 3, -1], [-2, 4, -1], [-1, 4, -1], [0, 4, -1], [1, 4, -1], [2, 4, -1], [-2, -4, 0], [-1, -4, 0], [0, -4, 0], [1, -4, 0], [2, -4, 0], [-3, -3, 0], [3, -3, 0], [-4, -2, 0], [4, -2, 0], [-4, -1, 0], [4, -1, 0], [-4, 0, 0], [4, 0, 0], [-4, 1, 0], [4, 1, 0], [-4, 2, 0], [4, 2, 0], [-3, 3, 0], [3, 3, 0], [-2, 4, 0], [-1, 4, 0], [0, 4, 0], [1, 4, 0], [2, 4, 0], [-2, -4, 1], [-1, -4, 1], [0, -4, 1], [1, -4, 1], [2, -4, 1], [-3, -3, 1], [3, -3, 1], [-4, -2, 1], [4, -2, 1], [-4, -1, 1], [4, -1, 1], [-4, 0, 1], [4, 0, 1], [-4, 1, 1], [4, 1, 1], [-4, 2, 1], [4, 2, 1], [-3, 3, 1], [3, 3, 1], [-2, 4, 1], [-1, 4, 1], [0, 4, 1], [1, 4, 1], [2, 4, 1], [-2, -4, 2], [-1, -4, 2], [0, -4, 2], [1, -4, 2], [2, -4, 2], [-3, -3, 2], [-2, -3, 2], [2, -3, 2], [3, -3, 2], [-4, -2, 2], [-3, -2, 2], [3, -2, 2], [4, -2, 2], [-4, -1, 2], [4, -1, 2], [-4, 0, 2], [4, 0, 2], [-4, 1, 2], [4, 1, 2], [-4, 2, 2], [-3, 2, 2], [3, 2, 2], [4, 2, 2], [-3, 3, 2], [-2, 3, 2], [2, 3, 2], [3, 3, 2], [-2, 4, 2], [-1, 4, 2], [0, 4, 2], [1, 4, 2], [2, 4, 2], [-2, -3, 3], [-1, -3, 3], [0, -3, 3], [1, -3, 3], [2, -3, 3], [-3, -2, 3], [-2, -2, 3], [2, -2, 3], [3, -2, 3], [-3, -1, 3], [3, -1, 3], [-3, 0, 3], [3, 0, 3], [-3, 1, 3], [3, 1, 3], [-3, 2, 3], [-2, 2, 3], [2, 2, 3], [3, 2, 3], [-2, 3, 3], [-1, 3, 3], [0, 3, 3], [1, 3, 3], [2, 3, 3], [-2, -2, 4], [-1, -2, 4], [0, -2, 4], [1, -2, 4], [2, -2, 4], [-2, -1, 4], [-1, -1, 4], [0, -1, 4], [1, -1, 4], [2, -1, 4], [-2, 0, 4], [-1, 0, 4], [0, 0, 4], [1, 0, 4], [2, 0, 4], [-2, 1, 4], [-1, 1, 4], [0, 1, 4], [1, 1, 4], [2, 1, 4], [-2, 2, 4], [-1, 2, 4], [0, 2, 4], [1, 2, 4], [2, 2, 4]];
|
||||
actual = px_sphere(5, false);
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
include <unittest.scad>;
|
||||
include <circle_path.scad>;
|
||||
|
||||
module test_along_with_default_angles() {
|
||||
echo("==== test_along_with_default_angles ====");
|
||||
|
||||
include <along_with.scad>;
|
||||
include <circle_path.scad>;
|
||||
|
||||
$fn = 24;
|
||||
|
||||
@ -25,7 +25,6 @@ module test_along_with_children() {
|
||||
echo("==== test_along_with_children ====");
|
||||
|
||||
include <along_with.scad>;
|
||||
include <circle_path.scad>;
|
||||
|
||||
$fn = 24;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
include <unittest.scad>;
|
||||
|
||||
module test_bend() {
|
||||
include <unittest.scad>;
|
||||
include <bend.scad>;
|
||||
|
||||
x = 9.25;
|
||||
|
@ -1,9 +1,9 @@
|
||||
include <unittest.scad>;
|
||||
include <bezier_curve.scad>;
|
||||
|
||||
module test_bezier_curve() {
|
||||
echo("==== test_bezier_curve ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <bezier_curve.scad>;
|
||||
|
||||
t_step = 0.05;
|
||||
width = 2;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
include <unittest.scad>;
|
||||
include <bezier_curve.scad>;
|
||||
include <bezier_surface.scad>;
|
||||
|
||||
module test_bezier_surface() {
|
||||
echo("==== test_bezier_surface ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <bezier_curve.scad>;
|
||||
include <bezier_surface.scad>;
|
||||
|
||||
t_step = 0.05;
|
||||
thickness = 0.5;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
include <unittest.scad>;
|
||||
include <circle_path.scad>;
|
||||
|
||||
module test_circle_path() {
|
||||
echo("==== test_circle_path ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <circle_path.scad>;
|
||||
|
||||
$fn = 24;
|
||||
|
||||
expected = [[50, 0], [48.2963, 12.941], [43.3013, 25], [35.3553, 35.3553], [25, 43.3013], [12.941, 48.2963], [0, 50], [-12.941, 48.2963], [-25, 43.3013], [-35.3553, 35.3553], [-43.3013, 25], [-48.2963, 12.941], [-50, 0], [-48.2963, -12.941], [-43.3013, -25], [-35.3553, -35.3553], [-25, -43.3013], [-12.941, -48.2963], [0, -50], [12.941, -48.2963], [25, -43.3013], [35.3553, -35.3553], [43.3013, -25], [48.2963, -12.941]];
|
||||
|
@ -1,12 +1,11 @@
|
||||
include <unittest.scad>;
|
||||
include <cross_sections.scad>;
|
||||
include <archimedean_spiral.scad>;
|
||||
include <rotate_p.scad>;
|
||||
|
||||
module test_cross_sections() {
|
||||
echo("==== test_cross_sections ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <polysections.scad>;
|
||||
include <cross_sections.scad>;
|
||||
include <archimedean_spiral.scad>;
|
||||
include <rotate_p.scad>;
|
||||
|
||||
shape_pts = [
|
||||
[-2, -10],
|
||||
[-2, 10],
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,10 +1,9 @@
|
||||
include <unittest.scad>;
|
||||
include <rotate_p.scad>;
|
||||
|
||||
module test_rotate_p() {
|
||||
echo("==== test_rotate_p ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <rotate_p.scad>;
|
||||
|
||||
point = [20, 0, 0];
|
||||
a = [0, -45, 45];
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
include <unittest.scad>;
|
||||
include <util/sub_str.scad>;
|
||||
include <util/split_str.scad>;
|
||||
include <util/parse_number.scad>;
|
||||
|
||||
module test_parse_number() {
|
||||
echo("==== test_parse_number ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <util/sub_str.scad>;
|
||||
include <util/split_str.scad>;
|
||||
include <util/parse_number.scad>;
|
||||
|
||||
assertEqualNum(11, parse_number("10") + 1);
|
||||
assertEqualNum(-0.1, parse_number("-1.1") + 1);
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
include <unittest.scad>;
|
||||
include <util/slice.scad>;
|
||||
|
||||
module test_slice() {
|
||||
echo("==== test_slice ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <util/slice.scad>;
|
||||
|
||||
lt = [for(c = "helloworld") c];
|
||||
expected1 = [for(c = "hello") c];
|
||||
expected2 = [for(c = "world") c];
|
||||
|
@ -1,9 +1,9 @@
|
||||
include <unittest.scad>;
|
||||
include <util/sort.scad>;
|
||||
|
||||
module test_sort() {
|
||||
echo("==== test_sort ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <util/sort.scad>;
|
||||
|
||||
assertEqualPoints(
|
||||
[[2, 0, 0], [5, 0, 0], [7, 0, 0], [9, 0, 0], [10, 0, 0]],
|
||||
sort([[10, 0, 0], [5, 0, 0], [7, 0, 0], [2, 0, 0], [9, 0, 0]], by = "x")
|
||||
|
@ -1,10 +1,10 @@
|
||||
include <unittest.scad>;
|
||||
include <util/sub_str.scad>;
|
||||
include <util/split_str.scad>;
|
||||
|
||||
module test_split_str() {
|
||||
echo("==== test_split_str ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <util/sub_str.scad>;
|
||||
include <util/split_str.scad>;
|
||||
|
||||
assert(["hello", "world","abc", "xyz"] == split_str("hello,world,abc,xyz", ","));
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
include <unittest.scad>;
|
||||
include <util/sub_str.scad>;
|
||||
|
||||
module test_sub_str() {
|
||||
echo("==== test_sub_str ====");
|
||||
|
||||
include <unittest.scad>;
|
||||
include <util/sub_str.scad>;
|
||||
|
||||
assert("hello" == sub_str("helloworld", 0, 5));
|
||||
assert("world" == sub_str("helloworld", 5));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user