aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish_tests.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-01 15:29:56 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-01 15:29:56 -0800
commitfb882f0b695d88a3211cdae97f18d955427b0b18 (patch)
tree8be6a6b1f55489165adeca0179bfc0a55cc936c1 /fish_tests.cpp
parent27cba56761de987c778937521987759475e27051 (diff)
Support for stack overflow and infinite recursion detection in new
parser
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r--fish_tests.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp
index 83f8976d..29f4e830 100644
--- a/fish_tests.cpp
+++ b/fish_tests.cpp
@@ -659,6 +659,14 @@ static void test_parser()
{
err(L"Invalid block mode when evaluating undetected");
}
+
+ /* These are disabled since they produce a long backtrace. We should find a way to either visually compress the backtrace, or disable error spewing */
+#if 1
+ /* Ensure that we don't crash on infinite self recursion and mutual recursion. These must use the principal parser because we cannot yet execute jobs on other parsers (!) */
+ say(L"Testing recursion detection");
+ parser_t::principal_parser().eval(L"function recursive ; recursive ; end ; recursive; ", io_chain_t(), TOP);
+ parser_t::principal_parser().eval(L"function recursive1 ; recursive2 ; end ; function recursive2 ; recursive1 ; end ; recursive1; ", io_chain_t(), TOP);
+#endif
}
static void test_indents()