1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 17:24:20 +02:00

updated testcase

This commit is contained in:
Justin Lin
2017-05-26 10:22:23 +08:00
parent 35d4c4e8bd
commit ea8ca50e2a

View File

@@ -1,91 +1,83 @@
include <unittest.scad>; include <unittest.scad>;
module test_line2d_cap_square() { module test_line2d() {
echo("==== test_line2d_cap_square ====");
$fn = 24; $fn = 24;
p1 = [0, 0]; p1 = [0, 0];
p2 = [5, 0]; p2 = [5, 0];
width = 1; width = 1;
include <line2d.scad>; module test_line2d_cap_square() {
echo("==== test_line2d_cap_square ====");
module cap(point, style) {
assertTrue( include <line2d.scad>;
(point == p1 && style == "CAP_SQUARE") ||
(point == p2 && style == "CAP_SQUARE") module cap(point, style) {
); assertTrue(
(point == p1 && style == "CAP_SQUARE") ||
(point == p2 && style == "CAP_SQUARE")
);
}
module test_line2d_line(angle, length, width, frags) {
assertEqual(0, angle);
assertEqual(5, length);
assertEqual(1, width);
assertEqual(24, frags);
}
line2d(p1 = p1, p2 = p2, width = width);
} }
module test_line2d_line(angle, length, width, frags) {
assertEqual(0, angle);
assertEqual(5, length);
assertEqual(1, width);
assertEqual(24, frags);
}
line2d(p1 = p1, p2 = p2, width = width);
}
module test_line2d_cap_round() { module test_line2d_cap_round() {
echo("==== test_line2d_cap_round ===="); echo("==== test_line2d_cap_round ====");
$fn = 24; include <line2d.scad>;
p1 = [0, 0]; module cap(point, style) {
p2 = [5, 0]; assertTrue(
width = 1; (point == p1 && style == "CAP_ROUND") ||
(point == p2 && style == "CAP_ROUND")
include <line2d.scad>; );
}
module cap(point, style) {
assertTrue(
(point == p1 && style == "CAP_ROUND") ||
(point == p2 && style == "CAP_ROUND")
);
}
module test_line2d_line(angle, length, width, frags) {
assertEqual(0, angle);
assertEqual(5, length);
assertEqual(1, width);
assertEqual(24, frags);
}
line2d(p1 = p1, p2 = p2, width = width,
p1Style = "CAP_ROUND", p2Style = "CAP_ROUND");
}
module test_line2d_cap_butt() {
echo("==== test_line2d_cap_butt ====");
$fn = 24;
p1 = [0, 0]; module test_line2d_line(angle, length, width, frags) {
p2 = [5, 0]; assertEqual(0, angle);
width = 1; assertEqual(5, length);
assertEqual(1, width);
include <line2d.scad>; assertEqual(24, frags);
}
module cap(point, style) {
assertTrue( line2d(p1 = p1, p2 = p2, width = width,
(point == p1 && style == "CAP_BUTT") || p1Style = "CAP_ROUND", p2Style = "CAP_ROUND");
(point == p2 && style == "CAP_BUTT") }
);
} module test_line2d_cap_butt() {
echo("==== test_line2d_cap_butt ====");
module test_line2d_line(angle, length, width, frags) {
assertEqual(0, angle); include <line2d.scad>;
assertEqual(5, length);
assertEqual(1, width); module cap(point, style) {
assertEqual(24, frags); assertTrue(
} (point == p1 && style == "CAP_BUTT") ||
(point == p2 && style == "CAP_BUTT")
line2d(p1 = p1, p2 = p2, width = width, );
p1Style = "CAP_BUTT", p2Style = "CAP_BUTT"); }
module test_line2d_line(angle, length, width, frags) {
assertEqual(0, angle);
assertEqual(5, length);
assertEqual(1, width);
assertEqual(24, frags);
}
line2d(p1 = p1, p2 = p2, width = width,
p1Style = "CAP_BUTT", p2Style = "CAP_BUTT");
}
test_line2d_cap_square();
test_line2d_cap_round();
test_line2d_cap_butt();
} }
test_line2d_cap_square(); test_line2d();
test_line2d_cap_round();
test_line2d_cap_butt();