mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-01 04:20:27 +02:00
changed function signature
This commit is contained in:
@@ -27,25 +27,23 @@ module assertEqualPoint(expected, actual) {
|
|||||||
function truncate_float_point(number) =
|
function truncate_float_point(number) =
|
||||||
number >= 0 ? floor(number) : ceil(number);
|
number >= 0 ? floor(number) : ceil(number);
|
||||||
|
|
||||||
function shift_to_int(pt, n) =
|
function shift_to_int(pt) =
|
||||||
len(pt) == 2 ?
|
len(pt) == 2 ?
|
||||||
[truncate_float_point(pt[0] * n), truncate_float_point(pt[1] * n)] :
|
[truncate_float_point(pt[0]), truncate_float_point(pt[1])] :
|
||||||
[truncate_float_point(pt[0] * n), truncate_float_point(pt[1] * n), truncate_float_point(pt[2] * n)];
|
[truncate_float_point(pt[0]), truncate_float_point(pt[1]), truncate_float_point(pt[2])];
|
||||||
|
|
||||||
shifted_expected = shift_to_int(
|
shifted_expected = shift_to_int(
|
||||||
expected,
|
expected * n
|
||||||
n
|
|
||||||
);
|
);
|
||||||
|
|
||||||
shifted_actual = shift_to_int(
|
shifted_actual = shift_to_int(
|
||||||
actual,
|
actual * n
|
||||||
n
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if(shifted_expected != shifted_actual) {
|
if(shifted_expected != shifted_actual) {
|
||||||
fail(
|
fail(
|
||||||
str("expected: ", shifted_expected,
|
str("expected: ", expected,
|
||||||
", but: ", shifted_actual)
|
", but: ", actual)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user