X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=basis%2Fcombinators%2Fshort-circuit%2Fsmart%2Fsmart-tests.factor;h=c8cf8ffc1bb3afc37a2845421e52426e61359f7d;hp=7ec4a0e6572a0818a39fcabc623d425e9f9957d5;hb=3f3d57032bf29190e9bee12d168a4bce6d74653c;hpb=cd1bb8f4c8afba318249c7b756a45aa1c46ea51e diff --git a/basis/combinators/short-circuit/smart/smart-tests.factor b/basis/combinators/short-circuit/smart/smart-tests.factor index 7ec4a0e657..c8cf8ffc1b 100644 --- a/basis/combinators/short-circuit/smart/smart-tests.factor +++ b/basis/combinators/short-circuit/smart/smart-tests.factor @@ -1,32 +1,18 @@ - USING: kernel math tools.test combinators.short-circuit.smart ; - IN: combinators.short-circuit.smart.tests -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: must-be-t ( in -- ) [ t ] swap unit-test ; -: must-be-f ( in -- ) [ f ] swap unit-test ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -[ { [ 1 ] [ 2 ] [ 3 ] } && 3 = ] must-be-t -[ 3 { [ 0 > ] [ odd? ] [ 2 + ] } && 5 = ] must-be-t -[ 10 20 { [ + 0 > ] [ - even? ] [ + ] } && 30 = ] must-be-t - -[ { [ 1 ] [ f ] [ 3 ] } && 3 = ] must-be-f -[ 3 { [ 0 > ] [ even? ] [ 2 + ] } && ] must-be-f -[ 10 20 { [ + 0 > ] [ - odd? ] [ + ] } && 30 = ] must-be-f - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -[ { [ 10 0 < ] [ f ] [ "factor" ] } || "factor" = ] must-be-t +[ t ] [ { [ 1 ] [ 2 ] [ 3 ] } && 3 = ] unit-test +[ t ] [ 3 { [ 0 > ] [ odd? ] [ 2 + ] } && 5 = ] unit-test +[ t ] [ 10 20 { [ + 0 > ] [ - even? ] [ + ] } && 30 = ] unit-test -[ 10 { [ odd? ] [ 100 > ] [ 1 + ] } || 11 = ] must-be-t +[ f ] [ { [ 1 ] [ f ] [ 3 ] } && 3 = ] unit-test +[ f ] [ 3 { [ 0 > ] [ even? ] [ 2 + ] } && ] unit-test +[ f ] [ 10 20 { [ + 0 > ] [ - odd? ] [ + ] } && 30 = ] unit-test -[ 10 20 { [ + odd? ] [ + 100 > ] [ + ] } || 30 = ] must-be-t +[ t ] [ { [ 10 0 < ] [ f ] [ "factor" ] } || "factor" = ] unit-test -[ { [ 10 0 < ] [ f ] [ 0 1 = ] } || ] must-be-f +[ t ] [ 10 { [ odd? ] [ 100 > ] [ 1 + ] } || 11 = ] unit-test -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +[ t ] [ 10 20 { [ + odd? ] [ + 100 > ] [ + ] } || 30 = ] unit-test +[ f ] [ { [ 10 0 < ] [ f ] [ 0 1 = ] } || ] unit-test