 >>
 
 : run-test-file ( path -- )
-    [ [ test-failures get ] dip '[ file>> _ = not ] filter-here ]
-    [ [ run-file ] [ swap file-failure ] recover ] bi ;
+    dup file [
+        test-failures get [ file>> file get = not ] filter-here
+        '[ _ run-file ] [ file-failure ] recover
+    ] with-variable ;
 
 : run-vocab-tests ( vocab -- )
     dup vocab source-loaded?>> [

    "--> test failed!" print
    <test-failure> test-failures get push ;

: file-failure ( error file -- )
    [ f ] [ f ] bi* failure ;

:: (unit-test) ( output input -- error ? )
    [ { } input with-datastack output assert-sequence= f f ] [ t ] recover ; inline

TEST: must-fail

M: test-failure summary
    asset>> [ [ experiment. ] with-string-writer ] [ "Top-level form" ] if* ;

M: test-failure error. ( error -- )
    [ call-next-method ]
