Was introduced as a work-around to get some debugging info out of scripts, but tests do now provide the same capability with a better output and, do so automatically.
- Update generics syntax
- Add required args to default validator function
This allows running a successful aiken build from
files generated by aiken new.
Pretty useful for debbugging. Though, on second-thoughts, this is
something we may want to review later and maybe have that done by
default for tests.
At the moment, we expects tests to unify to `bool`, and treat `false`
values as failing tests. Yet, on failures, this gives little
information about what's wrong with the test.
It'd be nice to either have better way to assert in tests, or, to
simply accept non-bool tests, and show whatever the test evaluates
to as a debug output.
```
Error:
× Main thread panicked.
├─▶ at crates/lang/src/uplc.rs:688:33
╰─▶ called `Option::unwrap()` on a `None` value
help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.
```
Note: the problem is only present when importing a builtin explicitly.
When using a qualified import, it compiles fine.
```
Error:
× Main thread panicked.
├─▶ at crates/lang/src/uplc.rs:3264:35
╰─▶ called `Option::unwrap()` on a `None` value
help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.
```
```
Error:
× Main thread panicked.
├─▶ at crates/lang/src/uplc.rs:530:41
╰─▶ not yet implemented
help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.
```
```
Error:
× Main thread panicked.
├─▶ at crates/lang/src/uplc.rs:4043:46
╰─▶ not yet implemented
help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.
```
```
Error:
× Main thread panicked.
├─▶ at crates/lang/src/uplc.rs:1518:45
╰─▶ called `Option::unwrap()` on a `None` value
help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.
```
```
Error:
× Main thread panicked.
├─▶ at crates/lang/src/uplc.rs:3264:35
╰─▶ called `Option::unwrap()` on a `None` value
help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.
```
This is an example of output from the formatter now:
```
//// Some module documentation
// foo
const a: Int = 42
// Some comment block
// For which newlines are respected.
// Foo
// Another one
/// add_one documentation
pub fn add_one(n: Int) -> Int {
// n + 1
n + 1
}
```
before this commit, comments would all be collapsed into one group
above the function as:
```
// Some comment block
// For which newlines are respected.
// Foo
// Another one
/// add_one documentation
pub fn add_one(n: Int) -> Int {
```