From b6d25ba090215b5baf78cc74a3d19374cb4ba847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Thu, 15 Jan 2015 05:07:40 +0000 Subject: [PATCH] compiler.tests.stack-trace: unit tests against the #1265 bugs --- basis/compiler/tests/stack-trace.factor | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/basis/compiler/tests/stack-trace.factor b/basis/compiler/tests/stack-trace.factor index 3d31245168..9c779cfe6d 100644 --- a/basis/compiler/tests/stack-trace.factor +++ b/basis/compiler/tests/stack-trace.factor @@ -1,6 +1,7 @@ -USING: compiler tools.test namespaces sequences -kernel.private kernel math continuations continuations.private -words splitting grouping sorting accessors ; +USING: accessors combinators.short-circuit compiler continuations +continuations.private fry generic generic.hook grouping io.backend +io.encodings.utf8 io.files io.files.temp kernel kernel.private math namespaces +parser sequences sorting splitting tools.test vocabs words ; IN: compiler.tests.stack-trace : symbolic-stack-trace ( -- newseq ) @@ -30,3 +31,15 @@ IN: compiler.tests.stack-trace \ + stack-trace-any? \ > stack-trace-any? ] unit-test + +! #1265: Checks that the quotation index never is f (it's -1 instead). +{ f } [ + [ normalize-path ] ignore-errors error-continuation get + call>> callstack>array [ f = ] any? +] unit-test + +! Crashes factor if compiled in debug mode. +[ ] [ + "USING: continuations io.backend ; [ normalize-path ] ignore-errors f" + "weird.factor" temp-file [ utf8 set-file-contents ] keep run-file +] unit-test