IN: tools.test.tests
-USING: tools.test tools.test.private namespaces kernel sequences ;
+USING: continuations debugger io.streams.string kernel namespaces
+sequences tools.test tools.test.private ;
-\ test-all must-infer
-
-: fake-unit-test ( quot -- )
- [
- "fake" file set
- V{ } clone test-failures set
- call
- test-failures get
- ] with-scope ; inline
-
-[ 1 ] [
+{ 1 } [
[
[ "OOPS" ] must-fail
] fake-unit-test length
-] unit-test
\ No newline at end of file
+] unit-test
+
+: create-test-failure ( -- error )
+ [ "hello" throw ] [
+ f "path" 25 error-continuation get test-failure boa
+ ] recover ;
+
+! Just verifies that the presented output contains a callstack.
+{ t } [
+ create-test-failure [ error. ] with-string-writer
+ "OBJ-CURRENT-THREAD" subseq-of?
+] unit-test