diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-04-13 10:39:45 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-05-17 14:27:59 +0200 |
| commit | e039552f9d7bb49da8dafe7a83b87a08202eb30f (patch) | |
| tree | 264b461722f758d85217da804550620cd74b4f9e /tests/typ/compiler/recursion.typ | |
| parent | 8e025c9cdfbb0a5dae536aafc27b5e19eeac1810 (diff) | |
Better test runner (#3922)
Diffstat (limited to 'tests/typ/compiler/recursion.typ')
| -rw-r--r-- | tests/typ/compiler/recursion.typ | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/tests/typ/compiler/recursion.typ b/tests/typ/compiler/recursion.typ deleted file mode 100644 index 421b638b..00000000 --- a/tests/typ/compiler/recursion.typ +++ /dev/null @@ -1,56 +0,0 @@ -// Test recursive function calls. -// Ref: false - ---- -// Test with named function. -#let fib(n) = { - if n <= 2 { - 1 - } else { - fib(n - 1) + fib(n - 2) - } -} - -#test(fib(10), 55) - ---- -// Test with unnamed function. -// Error: 17-18 unknown variable: f -#let f = (n) => f(n - 1) -#f(10) - ---- -// Test capturing with named function. -#let f = 10 -#let f() = f -#test(type(f()), function) - ---- -// Test capturing with unnamed function. -#let f = 10 -#let f = () => f -#test(type(f()), int) - ---- -// Test redefinition. -#let f(x) = "hello" -#let f(x) = if x != none { f(none) } else { "world" } -#test(f(1), "world") - ---- -// Error: 15-21 maximum function call depth exceeded -#let rec(n) = rec(n) + 1 -#rec(1) - ---- -// Test cyclic imports during layout. -// Error: 2-38 maximum show rule depth exceeded -// Hint: 2-38 check whether the show rule matches its own output -#layout(_ => include "recursion.typ") - ---- -// Test recursive show rules. -// Error: 22-25 maximum show rule depth exceeded -// Hint: 22-25 check whether the show rule matches its own output -#show math.equation: $x$ -$ x $ |
