Skip to content

Commit

Permalink
Add new acceptance test illustrating need for fn call ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ authored and MicroProofs committed May 6, 2024
1 parent 99c35a6 commit 0a660c6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/acceptance_tests/100/aiken.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Aiken
# You typically do not need to edit this file

requirements = []
packages = []

[etags]
9 changes: 9 additions & 0 deletions examples/acceptance_tests/100/aiken.toml
Original file line number Diff line number Diff line change
@@ -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"
14 changes: 14 additions & 0 deletions examples/acceptance_tests/100/lib/foo.ak
Original file line number Diff line number Diff line change
@@ -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([])
}

0 comments on commit 0a660c6

Please sign in to comment.