     "--> test failed!" print
     <test-failure> test-failures get push ;
 
-: file-failure ( error file -- )
-    [ f ] [ f ] bi* failure ;
+SYMBOL: file
+
+: file-failure ( error -- )
+    f file get f failure ;
 
 :: (unit-test) ( output input -- error ? )
     [ { } input with-datastack output assert-sequence= f f ] [ t ] recover ; inline

: experiment. ( seq -- )
    [ first write ": " write ] [ rest . ] bi ;

:: experiment ( word: ( -- error ? ) file line# -- )
    word <experiment> :> e
    e experiment.
    word execute [ e file line# failure ] [ drop ] if ; inline

: parse-test ( accum word -- accum )
    literalize parsed
    file get dup [ path>> ] when parsed
    lexer get line>> parsed
    \ experiment parsed ; 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 ]
