Paste: Inference error on a unit-test
Author: | rswarbrick |
Mode: | factor |
Date: | Wed, 24 Dec 2008 01:50:48 |
Plain Text |
USING: tools.test syntax kernel math arrays continuations sequences ;
IN: rjs.numerical
: in-range-interval? ( a b x -- ? )
dup swapd [ < ] [ > ] 2bi* and ;
: in-range-tgteps? ( tgt eps x -- ? )
[ [ - ] [ + ] 2bi ] dip
in-range-interval? ;
: unit-test-range ( outeps quot -- )
[ 2array ] 2keep
[ { } swap with-datastack
[ first2 ] [ first ] bi* in-range-tgteps? t assert=
] 2curry
(unit-test) ;
New Annotation