-
Add the dependency on this library to
sesterl.yaml
in your project:test_dependencies: - name: "sesterl_testing" source: type: "git" repository: "https://github.com/gfngfn/sesterl_testing" spec: type: "branch" value: "master"
-
Generate
rebar.config
fromsesterl.yaml
:$ sesterl config ./
-
Write unit tests (see the next section for detail).
-
Run them:
$ rebar3 sesterl test
Consider testing the following module Mod
for instance:
/* -- src/Mod.sest -- */
module Mod = struct
val add(m, n) = m + n
end
You can write unit tests for Mod
by providing the following module:
/* -- test/ModTests.sest -- */
import Mod
module ModTests = #[test] struct
#[test]
val add_test() =
Testing.it("integer addition", fun() ->
assert Testing.equal(
-expect 99,
-got Mod.add(42, 57),
)
end)
end