1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 01:04:07 +02:00

added __is_float

This commit is contained in:
Justin Lin
2017-06-22 14:55:11 +08:00
parent 2d7c303472
commit 2f3163c756
3 changed files with 5 additions and 3 deletions

View File

@@ -0,0 +1 @@
function __is_float(value) = value + 0 != undef;

View File

@@ -1,3 +1,5 @@
include <__private__/__is_float.scad>;
module fail(title, message) {
echo(
str(
@@ -84,8 +86,8 @@ module assertEqualPoints(expected, actual, float_digits = 4) {
}
module assertEqual(expected, actual, float_digits = 4) {
r_expected = round_n(expected, float_digits);
r_actual = round_n(actual, float_digits);
r_expected = __is_float(expected) ? round_n(expected, float_digits) : expected;
r_actual = __is_float(actual) ? round_n(actual, float_digits) : actual;
if(r_expected != r_actual) {
fail(

View File

@@ -1,4 +1,3 @@
include <unittest.scad>;
include <sub_str.scad>;