diff --git a/tools/testest/testest.factor b/tools/testest/testest.factor index 0fd71f1..06cdbd1 100644 --- a/tools/testest/testest.factor +++ b/tools/testest/testest.factor @@ -5,9 +5,16 @@ io io.streams.string io.styles kernel locals math namespaces parser prettyprint prettyprint.config prettyprint.custom quotations sequences splitting system ; IN: tools.testest -: describe#{ ( description -- starttime ) nl "%s" printf nl flush nano-count ; -: it#{ ( description -- starttime ) nl "%s" printf nl flush nano-count ; -: }# ( starttime -- ) nano-count swap - 1000000 / nl "%f ms" printf nl ; +DEFER: }# delimiter +: timed-block ( accum tag -- accum ) + \ }# parse-until >quotation '[ + nl _ printf nl flush nano-count _ dip + nano-count swap - 1000000 / nl "%f ms" printf nl + ] append! ; + +SYNTAX: describe#{ "%s" timed-block ; +SYNTAX: it#{ "%s" timed-block ; + ! user redefinable test result message quotations