Sky.Test
Types
type Test = Leaf String (() -> TestResult) | Suite String (List Test)
type TestResult = Passed | Failed String
Values
equal : a -> a -> TestResulterr : Result e a -> TestResult
Assert a Result is Err.
expectErrorKind : ErrorKind -> Result Error a -> TestResult
Assert a Result is Err with a specific ErrorKind. Most commonly
fail : String -> TestResult
Fail unconditionally with a message. Use sparingly — prefer a
isFalse : Bool -> TestResultisTrue : Bool -> TestResultjsonReport : List ( String, TestResult ) -> String
Render a completed run as machine-readable JSON.
notEqual : a -> a -> TestResultok : Result e a -> TestResult
Assert a Result is Ok. The Ok value is discarded — use `equal`
pass : TestResult
Pass unconditionally. Useful when an assertion is conditional and
run : List Test -> List ( String, TestResult )
Execute a list of tests and return the flat list of
suite : String -> List Test -> Testsummarise : List ( String, TestResult ) -> Bool
Print a human-readable summary. Returns True iff every test
test : String -> (() -> TestResult) -> TestwriteJsonReport : String -> List ( String, TestResult ) -> Task Error ()
Write `jsonReport` to `path`. An empty path is a no-op, so the
runMain
Convenience entry-point. A test module can declare: