-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include generics to get test cases working #166
Conversation
145dc5b
to
6bf313a
Compare
Rebased, added a new test (tried to work around test |
6bf313a
to
5c94f80
Compare
db4784c
to
8af4685
Compare
8af4685
to
c8f3def
Compare
Few TODOs from there: - [] Seems like the parser can't parse negative literals. Current work-around: write as `0 - n` instead of `-n`. - [] The formatter confuses tuples with function arguments in expression blocks. So writing: ``` let (xs, ys) = unzip(rest) ([x, ..xs], [y, ..ys]) ``` is wrongly turned into: ``` let (xs, ys) = unzip(rest)([x, ..xs], [y, ..ys]) ``` - [] Inline comments and function documentation comments are wrongly grouped together by the formatter. - [] The compiler panicks when two tests have the same name: ``` test foo() { todo } test foo() { todo } ``` ``` Error: × Main thread panicked. ├─▶ at crates/lang/src/tipo/infer.rs:181:43 ╰─▶ Could not find hydrator for fn help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace. ``` - As well as any acceptance tests added to: aiken-lang/aiken#166
test b passes
``` 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: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:4043:46 ╰─▶ not yet implemented help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace. ```
…{1,2,3,4,5,6} Also added a little Makefile to run them all in one go.
``` Error: aiken::check × Checking ╰─▶ Not a function ╭─[./007/lib/test.ak:4:1] 4 │ [(a, b), ..rest] -> { 5 │ let (a_tail, b_tail) = unzip(rest) · ────── 6 │ ([a, ..a_tail], [b, ..b_tail]) ╰──── ```
``` 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. ```
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:688:33 ╰─▶ 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:4022:40 ╰─▶ called `Option::unwrap()` on a `None` value ```
``` Error: × Main thread panicked. ├─▶ at crates/lang/src/uplc.rs:3413:34 ╰─▶ internal error: entered unreachable code: Var { scope: [ 0, 1, 3, 24, 25, 29, 32, ], constructor: ValueConstructor { public: false, variant: LocalVariable { location: 46..62, }, tipo: Fn { args: [ Var { tipo: RefCell { value: Link { tipo: App { public: true, module: "", name: "Int", args: [], }, }, }, }, ], ret: App { public: true, module: "", name: "Bool", args: [], }, }, }, name: "f", variant_name: "", } ```
``` ERROR: The provided Plutus code called 'error' ```
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.
3541bad
to
3c664b9
Compare
``` Error: × Main thread panicked. ├─▶ at crates/lang/src/uplc.rs:2388:21 ╰─▶ not yet implemented ```
6bc5806
to
bd956ef
Compare
Few TODOs from there: - [] Seems like the parser can't parse negative literals. Current work-around: write as `0 - n` instead of `-n`. - [] The formatter confuses tuples with function arguments in expression blocks. So writing: ``` let (xs, ys) = unzip(rest) ([x, ..xs], [y, ..ys]) ``` is wrongly turned into: ``` let (xs, ys) = unzip(rest)([x, ..xs], [y, ..ys]) ``` - [] Inline comments and function documentation comments are wrongly grouped together by the formatter. - [] The compiler panicks when two tests have the same name: ``` test foo() { todo } test foo() { todo } ``` ``` Error: × Main thread panicked. ├─▶ at crates/lang/src/tipo/infer.rs:181:43 ╰─▶ Could not find hydrator for fn help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace. ``` - As well as any acceptance tests added to: aiken-lang/aiken#166
And integrated test results with miette report.
cf4bf64
to
87546e0
Compare
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.
3a21167
to
e597264
Compare
38d44d9
to
5024bd8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving on with merging that one as-is, as it contains quite a few utilities for testing; useful to setup a continuous integration workflow on stdlib
No description provided.