Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gfngfn/sesterl_testing
A testing library for Sesterl wrapping EUnit
https://github.com/gfngfn/sesterl_testing
erlang sesterl testing-tools
Last synced: 8 days ago
JSON representation
A testing library for Sesterl wrapping EUnit
- Host: GitHub
- URL: https://github.com/gfngfn/sesterl_testing
- Owner: gfngfn
- Created: 2021-05-19T02:56:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-14T21:55:24.000Z (over 3 years ago)
- Last Synced: 2024-11-15T12:06:00.672Z (2 months ago)
- Topics: erlang, sesterl, testing-tools
- Language: Erlang
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# `sesterl_testing`: A Unit Testing Library for Sesterl Programs
## How to use
1. Add the dependency on this library to `sesterl.yaml` in your project:
```yaml
test_dependencies:
- name: "sesterl_testing"
source:
type: "git"
repository: "https://github.com/gfngfn/sesterl_testing"
spec:
type: "branch"
value: "master"
```2. Generate `rebar.config` from `sesterl.yaml`:
```console
$ sesterl config ./
```3. Write unit tests (see the next section for detail).
4. Run them:
```console
$ rebar3 sesterl test
```## How to write unit tests
Consider testing the following module `Mod` for instance:
```
/* -- src/Mod.sest -- */
module Mod = structval add(m, n) = m + n
end
```You can write unit tests for `Mod` by providing the following module:
```
/* -- test/ModTests.sest -- */
import Modmodule ModTests = #[test] struct
#[test]
val add_test() =
Testing.it("integer addition", fun() ->
assert Testing.equal(
-expect 99,
-got Mod.add(42, 57),
)
end)end
```