A unit test support for Standard ML using MLton.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
.gitignore
README.md
UnitTestML.smackspec
assertion-error.sml
testcase-open.sml
testcase.sig
testcase.sml
unittest-open.sml
unittest.mlb
unittest.sig
unittest.sml

README.md

UnitTestML

A unit test support for Standard ML using MLton.

Running tests

git clone git@github.com:cacilhas/UnitTestML.git
cd unittestml/
mlton tests/test.mlb
./tests/test

Installing

Install Smackage in order to manage your libs.

With Smackage installed, add UnitTestML to it and install:

smackage source UnitTestML git https://github.com/cacilhas/UnitTestML.git
smackage refresh
smackage get UnitTestML

Usage

Create a subdirectory tests/ inside your code’s root directory containing the following MLBasis:

(* tests/test.mlb *)
local
  $(SML_LIB)/basis/basis.mlb
  $(SMACKAGE)/UnitTestML/v1/unittest.mlb
  (* Your project’s MLBasis file here *)
in
  (*
   * Reference the spec files inside tests/ here
   *)
end

The file specs.sml in this very repository is a usage example: create a describe spec in each spec file containing other describe specs or tests (it fun) themselves.

For code consistency, we recommend using the "allowOptSemicolon true" ann. See test.mlb for an example.