| 1 | const expectEqual = @import("std").testing.expectEqual; |
| 2 | |
| 3 | fn fibonacci(index: u32) u32 { |
| 4 | //if (index < 2) return index; |
| 5 | return fibonacci(index - 1) + fibonacci(index - 2); |
| 6 | } |
| 7 | |
| 8 | test "fibonacci" { |
| 9 | try comptime expectEqual(13, fibonacci(7)); |
| 10 | } |
| 11 | |
| 12 | // test_error=overflow of integer type |