mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-17 04:04:16 +02:00
considered length
This commit is contained in:
@@ -33,28 +33,42 @@ function all_shift_to_int(points, digits) =
|
|||||||
[for(pt = points) shift_to_int(pt, digits) / digits];
|
[for(pt = points) shift_to_int(pt, digits) / digits];
|
||||||
|
|
||||||
module assertEqualPoint(expected, actual) {
|
module assertEqualPoint(expected, actual) {
|
||||||
n = 10000;
|
leng_expected = len(expected);
|
||||||
|
leng_actual = len(actual);
|
||||||
|
|
||||||
shifted_expected = shift_to_int(
|
if(leng_expected != leng_actual) {
|
||||||
expected, n
|
fail(
|
||||||
);
|
|
||||||
|
|
||||||
shifted_actual = shift_to_int(
|
|
||||||
actual, n
|
|
||||||
);
|
|
||||||
|
|
||||||
if(shifted_expected != shifted_actual) {
|
|
||||||
fail(
|
|
||||||
"assertEqualPoint",
|
"assertEqualPoint",
|
||||||
str("expected: ", shifted_expected / n,
|
str("expected length: ", leng_expected,
|
||||||
", but: ", shifted_actual / n)
|
", but: ", leng_actual)
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
n = 10000;
|
||||||
|
|
||||||
|
shifted_expected = shift_to_int(
|
||||||
|
expected, n
|
||||||
|
);
|
||||||
|
|
||||||
|
shifted_actual = shift_to_int(
|
||||||
|
actual, n
|
||||||
|
);
|
||||||
|
|
||||||
|
if(shifted_expected != shifted_actual) {
|
||||||
|
fail(
|
||||||
|
"assertEqualPoint",
|
||||||
|
str("expected: ", shifted_expected / n,
|
||||||
|
", but: ", shifted_actual / n)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module assertEqualPoints(expected, actual) {
|
module assertEqualPoints(expected, actual) {
|
||||||
leng_expected = len(expected);
|
leng_expected = len(expected);
|
||||||
leng_actual = len(actual);
|
leng_actual = len(actual);
|
||||||
|
|
||||||
if(leng_expected != leng_actual) {
|
if(leng_expected != leng_actual) {
|
||||||
fail(
|
fail(
|
||||||
"assertEqualPoints",
|
"assertEqualPoints",
|
||||||
|
Reference in New Issue
Block a user