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,7 @@
# This file was generated by Aiken
# You typically do not need to edit this file
requirements = []
packages = []
[etags]

View File

@ -0,0 +1,9 @@
name = "aiken-lang/acceptance_test_100"
version = "0.0.0"
license = "Apache-2.0"
description = "Aiken contracts for project 'aiken-lang/100'"
[repository]
user = "aiken-lang"
project = "100"
platform = "github"

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([])
}