From 34a197248c07a09c433ed11ebd92418e568016d3 Mon Sep 17 00:00:00 2001 From: Doug Coleman <doug.coleman@gmail.com> Date: Sun, 23 Nov 2014 16:51:40 -0800 Subject: [PATCH] tools.test: Print tests homoiconically. There is too much spacing still but it's better than before imo. See #1221. --- basis/tools/test/test.factor | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/basis/tools/test/test.factor b/basis/tools/test/test.factor index b559bf3977..f93e6029a2 100644 --- a/basis/tools/test/test.factor +++ b/basis/tools/test/test.factor @@ -76,8 +76,7 @@ M: did-not-fail summary drop "Did not fail" ; [ { } quot with-datastack drop did-not-fail-literal t ] [ drop f f ] recover ; : experiment-title ( word -- string ) - "(" ?head drop ")" ?tail drop - H{ { CHAR: - CHAR: \s } } substitute >title ; + "(" ?head drop ")" ?tail drop search ; MACRO: <experiment> ( word -- ) [ stack-effect in>> length dup ] @@ -85,8 +84,14 @@ MACRO: <experiment> ( word -- ) '[ _ ndup _ narray _ prefix ] ; : experiment. ( seq -- ) - [ first write ": " write ] - [ rest verbose-tests? get [ . ] [ short. ] if flush ] bi ; + [ + [ + rest verbose-tests? get + [ [ pprint* "" text ] each ] + [ [ [ pprint* "" text ] with-short-limits ] each ] if + ] + [ "" text first pprint-word flush ] bi + ] with-pprint nl ; :: experiment ( word: ( -- error ? ) line# -- ) word <experiment> :> e