oden/fine/tests/expression/worst_fib.fine
John Doty 5f0a0b3268 [fine] Many test improvements, error improvements
- Check for more error conditions
- Move to more definitive error assertions
- Simpler error messages in some cases
- Test more conditions more thoroughly, revisit old tests
2024-01-21 08:14:42 -08:00

22 lines
383 B
Text

fun worst_fib(n: f64) -> f64 {
if n == 0 {
0
} else if n == 1 {
1
} else {
worst_fib(n-2) + delegate_worst_fib(n-1)
}
}
// NOTE: This nonsense exists to make sure mutual recursion works, in
// addition to direct recursion.
fun delegate_worst_fib(n: f64) -> f64 {
worst_fib(n)
}
fun test() -> f64 {
worst_fib(10)
}
// @no-errors
// @eval: Float(55.0)