Skip to content

Commit

Permalink
Closes #909
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroProofs committed May 6, 2024
1 parent 14903f7 commit 2f61f59
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/aiken-project/src/test_framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1128,10 +1128,16 @@ impl Assertion<UntypedExpr> {
.to_string()
};

// head did not map to a constant
if self.head.is_err() {
return red("program failed");
}

// any value in tail did not map to a constant
if self.tail.is_err() {
return red("program failed");
}

fn fmt_side(side: &UntypedExpr, stream: Stream) -> String {
let __ = "│".if_supports_color(stream, |s| s.red());

Expand Down
16 changes: 16 additions & 0 deletions examples/acceptance_tests/102/aiken.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file was generated by Aiken
# You typically do not need to edit this file

[[requirements]]
name = "aiken-lang/stdlib"
version = "main"
source = "github"

[[packages]]
name = "aiken-lang/stdlib"
version = "main"
requirements = []
source = "github"

[etags]
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1715006768, nanos_since_epoch = 293270000 }, "5ee55dc5ccf269bb493f4cacb32096f0191a6adb2ef39d62a1f79b8c5a8fcc7f"]
14 changes: 14 additions & 0 deletions examples/acceptance_tests/102/aiken.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name = "aiken-lang/102"
version = "0.0.0"
license = "Apache-2.0"
description = "Aiken contracts for project 'aiken-lang/102'"

[repository]
user = "aiken-lang"
project = "102"
platform = "github"

[[dependencies]]
name = "aiken-lang/stdlib"
version = "main"
source = "github"
11 changes: 11 additions & 0 deletions examples/acceptance_tests/102/lib/tests.ak
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
test panic_aiken() {
and {
True,
should_fail(1),
}
}

fn should_fail(num) {
expect num == 0
True
}

0 comments on commit 2f61f59

Please sign in to comment.