From 1bc97b4624b5b57a1decadcde3b1a79d4821abc5 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 3 Sep 2009 17:27:06 -0500 Subject: [PATCH] add unit tests for comparisons against nan --- core/math/math-tests.factor | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/core/math/math-tests.factor b/core/math/math-tests.factor index 831430cf24..5d0e4a8465 100644 --- a/core/math/math-tests.factor +++ b/core/math/math-tests.factor @@ -36,3 +36,35 @@ IN: math.tests [ -0.0 ] [ 0.0 prev-float ] unit-test [ t ] [ 1.0 dup prev-float > ] unit-test [ t ] [ -1.0 dup prev-float > ] unit-test + +[ f ] [ 0/0. 0/0. = ] unit-test +[ f ] [ 0/0. 1.0 = ] unit-test +[ f ] [ 0/0. 1/0. = ] unit-test +[ f ] [ 0/0. -1/0. = ] unit-test + +[ f ] [ 0/0. 0/0. = ] unit-test +[ f ] [ 1.0 0/0. = ] unit-test +[ f ] [ -1/0. 0/0. = ] unit-test +[ f ] [ 1/0. 0/0. = ] unit-test + +[ f ] [ 0/0. 0/0. < ] unit-test +[ f ] [ 0/0. 1.0 < ] unit-test +[ f ] [ 0/0. 1/0. < ] unit-test +[ f ] [ 0/0. -1/0. < ] unit-test + +[ f ] [ 0/0. 0/0. <= ] unit-test +[ f ] [ 0/0. 1.0 <= ] unit-test +[ f ] [ 0/0. 1/0. <= ] unit-test +[ f ] [ 0/0. -1/0. <= ] unit-test + +[ f ] [ 0/0. 0/0. > ] unit-test +[ f ] [ 1.0 0/0. > ] unit-test +[ f ] [ -1/0. 0/0. > ] unit-test +[ f ] [ 1/0. 0/0. > ] unit-test + +[ f ] [ 0/0. 0/0. >= ] unit-test +[ f ] [ 1.0 0/0. >= ] unit-test +[ f ] [ -1/0. 0/0. >= ] unit-test +[ f ] [ 1/0. 0/0. >= ] unit-test + +