Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep timestamps off stack (Fix #41) #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tools/testest/testest.factor
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<DESCRIBE::>%s" printf nl flush nano-count ;
: it#{ ( description -- starttime ) nl "<IT::>%s" printf nl flush nano-count ;
: }# ( starttime -- ) nano-count swap - 1000000 / nl "<COMPLETEDIN::>%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 "<COMPLETEDIN::>%f ms" printf nl
] append! ;

SYNTAX: describe#{ "<DESCRIBE::>%s" timed-block ;
SYNTAX: it#{ "<IT::>%s" timed-block ;


! user redefinable test result message quotations

Expand Down
Loading