]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/test/test-tests.factor
4fe22334d78adcac380c9215536d62e1a87a5e3f
[factor.git] / basis / tools / test / test-tests.factor
1 IN: tools.test.tests
2 USING: continuations debugger io.streams.string kernel namespaces
3 sequences tools.test tools.test.private ;
4
5 { 1 } [
6     [
7         [ "OOPS" ] must-fail
8     ] fake-unit-test length
9 ] unit-test
10
11 : create-test-failure ( -- error )
12     [ "hello" throw ] [
13         f "path" 25 error-continuation get test-failure boa
14     ] recover ;
15
16 ! Just verifies that the presented output contains a callstack.
17 { t } [
18     create-test-failure [ error. ] with-string-writer
19     "OBJ-CURRENT-THREAD" subseq-index?
20 ] unit-test