]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/tools/test/test-tests.factor
core: subseq-index? -> subseq-of?
[factor.git] / basis / tools / test / test-tests.factor
index 03f7f006c9ce76edb147ee3f038bac006812da62..71c80992fa2e5de466dc5992496b65945ce8e357 100644 (file)
@@ -1,18 +1,20 @@
 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