]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.test: add a must-not-fail word for when we dont care about the results
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 11 Jan 2023 17:40:59 +0000 (11:40 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 11 Jan 2023 17:40:59 +0000 (11:40 -0600)
e.g. [ "/run/user/1001/doc" file-system-info ] must-not-fail

basis/tools/test/test.factor

index 4f3f2ca8a845fa077d39a007e976a3dbd7a68210..ddcfc03476319ebbc9695b3e3ad67ce6c1007542 100644 (file)
@@ -103,6 +103,9 @@ M: did-not-fail summary drop "Did not fail" ;
 :: (must-fail) ( quot -- error/f failed? tested? )
     [ { } quot with-datastack drop did-not-fail t ] [ drop f f ] recover t ;
 
+:: (must-not-fail) ( quot -- error/f failed? tested? )
+    [ { } quot with-datastack drop f f ] [ t ] recover t ;
+
 : experiment-title ( word -- string )
     "(" ?head drop ")" ?tail drop
     H{ { CHAR: - CHAR: \s } } substitute >title ;
@@ -211,6 +214,7 @@ TEST: must-infer-as
 TEST: must-infer
 TEST: must-fail-with
 TEST: must-fail
+TEST: must-not-fail
 
 M: test-failure error. ( error -- )
     {