/UnitTestML

A unit test support for Standard ML using MLton.

Primary LanguageStandard ML

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.