1 USING: kernel layouts math quotations tools.test typed ;
4 TYPED: f+ ( a: float b: float -- c: float )
8 [ 2 1+1/2 f+ ] unit-test
10 TYPED: fix+ ( a: fixnum b: fixnum -- c: fixnum )
13 most-positive-fixnum neg 1 - 1quotation
14 [ most-positive-fixnum 1 fix+ ] unit-test
19 TYPED: dee ( x: tweedle-dee -- y )
22 TYPED: dum ( x: tweedle-dum -- y )
25 [ \ tweedle-dum new dee ] [ input-mismatch-error? ] must-fail-with
26 [ \ tweedle-dee new dum ] [ input-mismatch-error? ] must-fail-with
29 TYPED: dumdum ( x -- y: tweedle-dum )
30 drop \ tweedle-dee new ;
32 [ f dumdum ] [ output-mismatch-error? ] must-fail-with
34 TYPED:: f+locals ( a: float b: float -- c: float )
37 [ 3.5 ] [ 2 1+1/2 f+locals ] unit-test