tools.test: Print tests homoiconically. There is too much spacing still
but it's better than before imo. See #1221.db4
parent
fb0cae4790
commit
34a197248c
|
@ -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 ;
|
[ { } quot with-datastack drop did-not-fail-literal t ] [ drop f f ] recover ;
|
||||||
|
|
||||||
: experiment-title ( word -- string )
|
: experiment-title ( word -- string )
|
||||||
"(" ?head drop ")" ?tail drop
|
"(" ?head drop ")" ?tail drop search ;
|
||||||
H{ { CHAR: - CHAR: \s } } substitute >title ;
|
|
||||||
|
|
||||||
MACRO: <experiment> ( word -- )
|
MACRO: <experiment> ( word -- )
|
||||||
[ stack-effect in>> length dup ]
|
[ stack-effect in>> length dup ]
|
||||||
|
@ -85,8 +84,14 @@ MACRO: <experiment> ( word -- )
|
||||||
'[ _ ndup _ narray _ prefix ] ;
|
'[ _ ndup _ narray _ prefix ] ;
|
||||||
|
|
||||||
: experiment. ( seq -- )
|
: 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# -- )
|
:: experiment ( word: ( -- error ? ) line# -- )
|
||||||
word <experiment> :> e
|
word <experiment> :> e
|
||||||
|
|
Loading…
Reference in New Issue