Add some tests that make the compiler panick.

This commit is contained in:
KtorZ
2022-12-09 18:47:21 +01:00
parent 95986fed83
commit 04c05f8d63
6 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
pub fn length(xs: List(a)) -> Int {
when xs is {
[] -> 0
[_, ..rest] -> 1 + length(rest)
}
}
test length_1() {
length([1, 2, 3]) == 3
}
test length_2() {
length([]) == 0
}