Commit Graph

162 Commits

Author SHA1 Message Date
Matthias Benkort d9d1310c6d
Merge pull request #166 from aiken-lang/some-interesting-test-cases
Include generics to get test cases working
2022-12-15 02:07:05 +01:00
KtorZ 5024bd884c
Remove debug line for pretty-printing test, and add '--debug' flag to 'check instead. 2022-12-15 02:02:10 +01:00
KtorZ e5972640d2
Remove 'eval' command.
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.
2022-12-14 22:14:35 +01:00
KtorZ 921e7abbb6
Move pretty-printing utilities to project::pretty 2022-12-14 21:59:09 +01:00
KtorZ 87546e0abd
Return non-zero exit code on test failure
And integrated test results with miette report.
2022-12-14 18:44:31 +01:00
Carlos Souza c77b7c293b Fix errors on aiken build
- Update generics syntax
- Add required args to default validator function

This allows running a successful aiken build from
files generated by aiken new.
2022-12-14 12:03:30 -05:00
KtorZ 3a9cc668fc
Use bright_black (i.e. grey) for box drawing. 2022-12-14 17:45:16 +01:00
KtorZ 2d6fc8bd54
Group test results by module. 2022-12-14 17:34:24 +01:00
Kasey White 6635a918b5
clean up minor warnings 2022-12-14 09:45:26 +01:00
KtorZ b6962ba9d3
Add 'eval' command to evaluate target aiken function
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.
2022-12-14 09:45:26 +01:00
KtorZ 1637a0d30e Add --match-tests to 'check' cmd
For running only tests matching a certain pattern. Useful when doing TDD.
2022-12-13 10:34:34 -05:00
KtorZ 0eb3cf221b
Trigger and report on more events in the compilation pipeline. 2022-12-09 15:04:02 +01:00
KtorZ d09d38d65b
Add a flag '--skip-tests' to the 'check' cmd.
So that tests can be skipped, and the old behavior recovered if necessary.

  Tests execution is on by default however.
2022-12-09 14:14:15 +01:00
rvcas 4ad74bef1f
refactor: move prints to cli via EventListener trait 2022-12-08 19:25:28 -05:00
KtorZ 5770ea2456
Make test runner more sexy.
Using colors.
2022-12-08 19:25:28 -05:00
rvcas f250d3df84
feat: eval should take initial budget 2022-12-08 19:24:20 -05:00
Kasey White 3f47a1f4b8 fix: constr issue
- also fixed constant parsing
- added new cbor flag to eval

Co-authored-by: rvcas <x@rvcas.dev>
2022-12-05 22:55:57 -05:00
vh-zuka 269cf8c13f fix: update aiken new 2022-11-26 10:30:41 -05:00
rvcas 67d160230b feat: new build command flag
- `uplc` to optionally dump raw uplc
2022-11-24 18:17:03 -05:00
rvcas 0358952984
Release 0.0.26
aiken@0.0.26
aiken-lang@0.0.26
aiken-lsp@0.0.26
aiken-project@0.0.26

Generated by cargo-workspaces
2022-11-23 00:31:24 -05:00
jacfra 0069c1f68a correct typo 2022-11-19 15:35:07 -05:00
rvcas f089eff97d
Release 0.0.25
aiken@0.0.25
aiken-lang@0.0.25
aiken-lsp@0.0.25
aiken-project@0.0.25
uplc@0.0.25

Generated by cargo-workspaces
2022-11-14 18:04:19 -05:00
vh-zuka 2736df5466 Validate project name on aiken new 2022-11-14 14:15:02 -05:00
vh-zuka bdf91d287b Add a few more files 2022-11-10 01:45:32 -05:00
vh-zuka 9d6f9fd013 Use indoc for better raw text 2022-11-10 01:45:32 -05:00
vh-zuka 3faed5c980 Add new project template 2022-11-10 01:45:32 -05:00
rvcas e90a210537 feat: add a basic lsp 2022-11-10 01:27:18 -05:00
rvcas 9d14acbe0a
fix: when formatting and add some methods to Project::Error 2022-11-05 16:23:46 -04:00
rvcas cba7a6f46e
feat: bring over the formatter from gleam 2022-11-05 15:35:11 -04:00
rvcas 3df275043a
Release 0.0.24
aiken@0.0.24
aiken-lang@0.0.24
aiken-project@0.0.24
uplc@0.0.24

Generated by cargo-workspaces
2022-11-04 13:56:15 -04:00
rvcas c4db8c951f
Release 0.0.23
aiken@0.0.23
aiken-lang@0.0.23
aiken-project@0.0.23
uplc@0.0.23

Generated by cargo-workspaces
2022-11-03 20:27:03 -04:00
rvcas 1b6e5d262f
Release 0.0.22
aiken@0.0.22
aiken-lang@0.0.22
aiken-project@0.0.22
uplc@0.0.22

Generated by cargo-workspaces
2022-10-31 13:32:54 -04:00
rvcas 09462bbb42
chore: rename project to aiken-project 2022-10-31 13:25:19 -04:00
KtorZ 4316d5c382
Factor out common project-logic between build and check. 2022-10-28 17:20:41 +02:00
KtorZ 8d45b2a2f5
Enforce ordering of commands/sub-commands according to source
By default, clap orders command alphabetically, which can be quite
    confusing when listing commands with `--help`:

    ```
    SUBCOMMANDS:
        eval      Evaluate an Untyped Plutus Core program
        flat      Encode textual Untyped Plutus Core to flat bytes
        fmt       Format an Untyped Plutus Core program
        help      Print this message or the help of the given subcommand(s)
        unflat    Decode flat bytes to textual Untyped Plutus Cor
    ```

    It is possible to instrument clap to order commands in the same way
    they are declared in the source, giving us back the freedom to order
    and group them in a manner that makes sense, e.g.:

    ```
    SUBCOMMANDS:
        fmt       Format an Untyped Plutus Core program
        eval      Evaluate an Untyped Plutus Core program
        flat      Encode textual Untyped Plutus Core to flat bytes
        unflat    Decode flat bytes to textual Untyped Plutus Cor
        help      Print this message or the help of the given subcommand(s)
    ```
2022-10-28 17:20:41 +02:00
KtorZ 9c608ad9f1
Refactor cli's crate; split code into a hierarchy of modules.
This follows a simple convention:

    - `main.rs` contains as little as possible and delegates both
      data-types definitions and command executions to sub-modules.

    - modules are named after their respective commands. For
      sub-commands,

    - Each command module can be in one of two forms:

      - Either it is a leaf command, and it then contains an `Args`
	struct that defines the command arguments; and a function
	`exec` when outlines the execution logic.

      - Or, it is a group command with multiple sub-commands. In which
	case the module defines a `Cmd` struct encapsulating all
	sub-commands; and also an `exec` function which simply
	dispatches the logic to sub-functions.

    ---

    This commit also removes the `dev` command which is currently
    unused. The rationale being: if it's not there, it's not there.
2022-10-28 17:20:39 +02:00
KtorZ 6d0d938fb9
Extra project utilities in their own crate.
This was currently in the 'cli' crates, but this code is pretty standalone and need not to be mixed with the rest of the cli logic.
  Ideally, we want the cli crate to be only a thin wrapper over functionality available from the rest of the lib crates.
2022-10-28 13:48:40 +02:00
rvcas 819256df99 feat: wrap up adding uplc builtins for now 2022-10-25 18:52:27 -04:00
rvcas d5d2ba9cd7 feat: start creating aiken/builtin module 2022-10-25 18:52:27 -04:00
rvcas a41d05f7b6 feat: change project structure 2022-10-24 00:09:00 -04:00
rvcas 825783ca61 feat: typecheck If expressions 2022-10-24 00:09:00 -04:00
rvcas 5244e58c9f feat: typechecking is working 2022-10-24 00:09:00 -04:00
rvcas cabc653167 feat: start expr inference 2022-10-24 00:09:00 -04:00
rvcas 81c87ab4da feat: register import, types, and values in environment 2022-10-24 00:09:00 -04:00
rvcas d0287d418b feat: add prelude 2022-10-24 00:09:00 -04:00
rvcas 4df3de0a03 feat: some boilerplate for typechecking 2022-10-24 00:09:00 -04:00
rvcas ed2ef4fa9b feat: sort modules and detect cycles 2022-10-24 00:09:00 -04:00
rvcas 15c774b7d0
Release 0.0.21
aiken@0.0.21
flat-rs@0.0.21
uplc@0.0.21

Generated by cargo-workspaces
2022-10-23 17:58:21 -04:00
rvcas ce875a3c47
Release 0.0.20
aiken@0.0.20
aiken-lang@0.0.20
flat-rs@0.0.20
uplc@0.0.20

Generated by cargo-workspaces
2022-10-17 17:22:50 -04:00
alessandrokonrad a14dae5863 changed slot_length to u32 2022-10-17 08:35:45 -04:00