From ce7cf8122435c2e8be6386a388faf5dab476e65f Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 4 Oct 2008 12:45:10 -0500 Subject: [PATCH] add more unit tests --- basis/math/intervals/intervals-tests.factor | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/basis/math/intervals/intervals-tests.factor b/basis/math/intervals/intervals-tests.factor index 7d8d496737..481b065a1c 100644 --- a/basis/math/intervals/intervals-tests.factor +++ b/basis/math/intervals/intervals-tests.factor @@ -1,6 +1,6 @@ USING: math.intervals kernel sequences words math math.order arrays prettyprint tools.test random vocabs combinators -accessors ; +accessors math.constants ; IN: math.intervals.tests [ empty-interval ] [ 2 2 (a,b) ] unit-test @@ -334,3 +334,13 @@ IN: math.intervals.tests [ execute ] [ swapd execute ] 3bi = ] all? ] unit-test + +[ t ] [ 1.0 1.0 epsilon + [a,b] random float? ] unit-test +[ t ] [ 1.0 1.0 epsilon + [a,b) random float? ] unit-test +[ t ] [ 1.0 1.0 epsilon + (a,b] random float? ] unit-test +[ 1.0 1.0 (a,b) random float? ] must-fail + +[ 3 4 + (a,b) random ] must-fail +[ 3 ] [ 3 4 [a,b) random ] unit-test +[ 4 ] [ 3 4 (a,b] random ] unit-test +[ t ] [ 3 4 [a,b] random { 3 4 } member? ] unit-test