From 898a28de86600b62ddd5f971b910eaadc222bbb7 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 18 Oct 2020 18:06:54 +0200 Subject: ast, eval: add recursion limit Signed-off-by: Jo-Philipp Wich --- tests/02_runtime/06_recursion | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests/02_runtime') diff --git a/tests/02_runtime/06_recursion b/tests/02_runtime/06_recursion index e707c86..028feba 100644 --- a/tests/02_runtime/06_recursion +++ b/tests/02_runtime/06_recursion @@ -33,3 +33,28 @@ Testing recursive invocations. test(1); %} -- End -- + + +2. Testing infinite recursion. + +-- Expect stderr -- +Runtime error: Too much recursion +In test(), line 3, byte 7: + at function test ([stdin]:3:7) + at main function ([stdin]:6:6) + + ` test();` + Near here --^ + + +-- End -- + +-- Testcase -- +{% + function test() { + test(); + } + + test(); +%} +-- End -- -- cgit v1.2.3