From be8b30974ac28ec91e8000accb76665654846f35 Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Wed, 15 Jan 2020 20:27:01 -0800 Subject: [PATCH] Added is_int() regressions --- tests/test_common.scad | 44 ++++++++++++++++++++++++++++++++++++++++++ version.scad | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/tests/test_common.scad b/tests/test_common.scad index 9a1349b..4710965 100644 --- a/tests/test_common.scad +++ b/tests/test_common.scad @@ -89,6 +89,50 @@ module test_is_str() { test_is_str(); +module test_is_int() { + assert(is_int(-999)); + assert(is_int(-1)); + assert(is_int(0)); + assert(is_int(1)); + assert(is_int(999)); + assert(!is_int(-1.1)); + assert(!is_int(1.1)); + assert(!is_int(-0.1)); + assert(!is_int(0.1)); + assert(!is_int(-99.1)); + assert(!is_int(99.1)); + assert(!is_int(undef)); + assert(!is_int(false)); + assert(!is_int(true)); + assert(!is_int("foo")); + assert(!is_int([0,1,2])); + assert(!is_int([0:1:2])); +} +test_is_int(); + + +module test_is_integer() { + assert(is_integer(-999)); + assert(is_integer(-1)); + assert(is_integer(0)); + assert(is_integer(1)); + assert(is_integer(999)); + assert(!is_integer(-1.1)); + assert(!is_integer(1.1)); + assert(!is_integer(-0.1)); + assert(!is_integer(0.1)); + assert(!is_integer(-99.1)); + assert(!is_integer(99.1)); + assert(!is_integer(undef)); + assert(!is_integer(false)); + assert(!is_integer(true)); + assert(!is_integer("foo")); + assert(!is_integer([0,1,2])); + assert(!is_integer([0:1:2])); +} +test_is_integer(); + + module test_default() { assert(default(undef,23) == 23); assert(default(true,23) == true); diff --git a/version.scad b/version.scad index b9abd3b..edc9da7 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,89]; +BOSL_VERSION = [2,0,90]; // Section: BOSL Library Version Functions