aiken-lang / aiken

A modern smart contract platform for Cardano
https://aiken-lang.org
Apache License 2.0
454 stars 84 forks source link

Failing tests print no traces #872

Closed Quantumplation closed 6 months ago

Quantumplation commented 6 months ago

What Git revision are you using?

main

What operating system are you using, and which version?

Describe what the problem is?

test xyz() {
  trace @"ABC"
  // expect 1 == 0
  // expect Some(3) = None
  True
}

When running the above test, it will correctly trace ABC.

However, if you uncomment either of the commented out lines, suddenly all traces disappear into a black hole, and the test prints nothing.

image

What should be the expected behavior?

Ideally we'd still see traces on failure (that's when we most want to see them), and see a useful description of what the failed expect was.

Quantumplation commented 6 months ago

@MicroProofs pointed out that you can work around this temporarily by adding fail to the test, and that also the reverse is true: if you have an expected failure test, and it passes, you get no traces.