]> gitweb.factorcode.org Git - factor.git/blob - core/tools/test.facts
more sql changes
[factor.git] / core / tools / test.facts
1 IN: test
2 USING: help kernel ;
3
4 HELP: benchmark
5 { $values { "quot" "a quotation" } { "gctime" "an integer denoting milliseconds" } { "runtime" "an integer denoting milliseconds" } }
6 { $description "Runs a quotation, measuring the total wall clock time and the total time spent in the garbage collector." }
7 { $notes "A nicer word for interactive use is " { $link time } "." } ;
8
9 HELP: time
10 { $values { "quot" "a quotation" } }
11 { $description "Runs a quotation and then prints the total run time and time spent in the garbage collector." }
12 { $examples
13     { $example "[ 1000000 0 [ + ] reduce drop ] time" "1116 ms run / 6 ms GC time" }
14 } ;
15
16 HELP: unit-test
17 { $values { "output" "a sequence of expected stack elements" } { "input" "a quotation run with an empty stack" } }
18 { $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." } ;
19
20 HELP: unit-test-fails
21 { $values { "quot" "a quotation run with an empty stack" } }
22 { $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." }
23 { $notes "This word is used to test boundary conditions and fail-fast behavior." } ;