factor/core/tools/test.facts

24 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2006-03-25 01:06:52 -05:00
IN: test
USING: help kernel ;
2006-08-16 21:55:53 -04:00
HELP: benchmark
2006-03-25 01:06:52 -05:00
{ $values { "quot" "a quotation" } { "gctime" "an integer denoting milliseconds" } { "runtime" "an integer denoting milliseconds" } }
{ $description "Runs a quotation, measuring the total wall clock time and the total time spent in the garbage collector." }
{ $notes "A nicer word for interactive use is " { $link time } "." } ;
2006-08-16 21:55:53 -04:00
HELP: time
2006-03-25 01:06:52 -05:00
{ $values { "quot" "a quotation" } }
{ $description "Runs a quotation and then prints the total run time and time spent in the garbage collector." }
{ $examples
{ $example "[ 1000000 0 [ + ] reduce drop ] time" "1116 ms run / 6 ms GC time" }
} ;
2006-08-16 21:55:53 -04:00
HELP: unit-test
2006-03-25 01:06:52 -05:00
{ $values { "output" "a sequence of expected stack elements" } { "input" "a quotation run with an empty stack" } }
{ $description "Runs a quotation with an empty stack, comparing the resulting stack with " { $snippet "output" } ". Elements are compared using " { $link = } ". Throws an error if the expected stack does not match the resulting stack." } ;
2006-08-16 21:55:53 -04:00
HELP: unit-test-fails
2006-03-25 01:06:52 -05:00
{ $values { "quot" "a quotation run with an empty stack" } }
{ $description "Runs a quotation with an empty stack, expecting it to throw an error. If the quotation throws an error, this word returns normally. If the quotation does not throw an error, this word " { $emphasis "does" } " raise an error." }
{ $notes "This word is used to test boundary conditions and fail-fast behavior." } ;