tools.test: less duplication in unit-test~/v~.
parent
47b45ccad3
commit
154de53470
|
@ -66,15 +66,16 @@ SYMBOL: current-test-file
|
||||||
|
|
||||||
: (unit-test-comparator) ( output input comparator -- error/f failed? tested? )
|
: (unit-test-comparator) ( output input comparator -- error/f failed? tested? )
|
||||||
swapd '[
|
swapd '[
|
||||||
{ } _ with-datastack
|
{ } _ with-datastack _ >quotation
|
||||||
_ >quotation _ compose with-datastack first dup not
|
[ 3dup @ [ 3drop t ] [ drop assert ] if ] compose
|
||||||
|
with-datastack first dup not
|
||||||
] [ t ] recover t ; inline
|
] [ t ] recover t ; inline
|
||||||
|
|
||||||
: (unit-test~) ( output input -- error/f failed? tested? )
|
: (unit-test~) ( output input -- error/f failed? tested? )
|
||||||
[ 3dup ~ [ 3drop t ] [ drop assert ] if ] (unit-test-comparator) ;
|
[ ~ ] (unit-test-comparator) ;
|
||||||
|
|
||||||
: (unit-test-v~) ( output input -- error/f failed? tested? )
|
: (unit-test-v~) ( output input -- error/f failed? tested? )
|
||||||
[ 3dup v~ [ 3drop t ] [ drop assert ] if ] (unit-test-comparator) ;
|
[ v~ ] (unit-test-comparator) ;
|
||||||
|
|
||||||
: short-effect ( effect -- pair )
|
: short-effect ( effect -- pair )
|
||||||
[ in>> length ] [ out>> length ] bi 2array ;
|
[ in>> length ] [ out>> length ] bi 2array ;
|
||||||
|
|
Loading…
Reference in New Issue