Add new acceptance test illustrating need for fn call ordering

This commit is contained in:
KtorZ
2024-05-05 14:27:32 +02:00
committed by Kasey
parent 99c35a6459
commit 0a660c6a21
3 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
pub fn list(fuzzer: Option<a>) -> Option<List<a>> {
inner(fuzzer, [])
}
fn inner(fuzzer, xs) -> Option<List<b>> {
when fuzzer is {
None -> Some(xs)
Some(x) -> Some([x, ..xs])
}
}
test foo() {
list(None) == Some([])
}