Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxalexweber1 committed Oct 27, 2024
0 parents commit 282849b
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Continuous Integration

on:
push:
branches: ["main"]
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: aiken-lang/setup-aiken@v1
with:
version: v1.1.5
- run: aiken fmt --check
- run: aiken check -D
- run: aiken build
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Aiken compilation artifacts
artifacts/
# Aiken's project working directory
build/
# Aiken's default documentation export
docs/
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# primitive-types

Write validators in the `validators` folder, and supporting functions in the `lib` folder using `.ak` as a file extension.

```aiken
validator my_first_validator {
spend(_datum: Option<Data>, _redeemer: Data, _output_reference: Data, _context: Data) {
True
}
}
```

## Building

```sh
aiken build
```

## Configuring

**aiken.toml**
```toml
[config.default]
network_id = 41
```

Or, alternatively, write conditional environment modules under `env`.

## Testing

You can write tests in any module using the `test` keyword. For example:

```aiken
use config
test foo() {
config.network_id + 1 == 42
}
```

To run all tests, simply do:

```sh
aiken check
```

To run only tests matching the string `foo`, do:

```sh
aiken check -m foo
```

## Documentation

If you're writing a library, you might want to generate an HTML documentation for it.

Use:

```sh
aiken docs
```

## Resources

Find more on the [Aiken's user manual](https://aiken-lang.org).
15 changes: 15 additions & 0 deletions aiken.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Aiken
# You typically do not need to edit this file

[[requirements]]
name = "aiken-lang/stdlib"
version = "v2.1.0"
source = "github"

[[packages]]
name = "aiken-lang/stdlib"
version = "v2.1.0"
requirements = []
source = "github"

[etags]
18 changes: 18 additions & 0 deletions aiken.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name = "maxalexweber1/primitive-types"
version = "0.0.0"
compiler = "v1.1.5"
plutus = "v3"
license = "Apache-2.0"
description = "Aiken contracts for project 'maxalexweber1/primitive-types'"

[repository]
user = "maxalexweber1"
project = "primitive-types"
platform = "github"

[[dependencies]]
name = "aiken-lang/stdlib"
version = "v2.1.0"
source = "github"

[config]
19 changes: 19 additions & 0 deletions lib/primitives.ak
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use cardano/assets.{Lovelace}

test integer() {
let i: Int = 5
let n = 6

let ada: Lovelace = 2_000_000

// 1 ADA = 1Mio Lovelance
let h = 0xff

//
and {
i == 5,
n == 6,
ada == 2_000_000,
h == 0xff,
}
}

0 comments on commit 282849b

Please sign in to comment.