unit_threaded.light

This module is an attempt to alleviate compile times by including the bare minimum. The idea is that while the reporting usually done by unit-threaded is welcome, it only really matters when tests fail. Otherwise, no news is good news.

Likewise, naming and selecting tests are features used when certain tests fail. The usual way to run tests is to run all of them and be happy if they all pass.

This module makes it so that unit-threaded gets out of the way, and if needed the full features can be turned on at the cost of compiling much more slowly.

There aren't even any template constraints on the should functions to avoid imports as much as possible.

Members

Aliases

UnitTestException
alias UnitTestException = Exception
Undocumented in source.

Classes

TestCase
class TestCase

Dummy version of unit_threaded.testcase.TestCase

Enums

isLikeAssociativeArray
eponymoustemplate isLikeAssociativeArray(T, K)
Undocumented in source.

Functions

allTestData
int[] allTestData()

Dummy version so "normal" code compiles

check
void check(int numFuncCalls, string file, size_t line)

Same as unit_threaded.property.check

checkCustom
void checkCustom(int numFuncCalls, string file, size_t line)

Same as unit_threaded.property.checkCustom

fail
void fail(string output, string file, size_t line)
Undocumented in source. Be warned that the author may not have intended to support it.
mock
auto mock()

Same as unit_threaded.mock.mock

mockStruct
auto mockStruct(T returns)

Same as unit_threaded.mock.mockStruct

runTests
int runTests(string[] args)
int runTests(string[] args, T testData)

Dummy version of runTests so "normal" code compiles.

runTestsImpl
int runTestsImpl()
Undocumented in source. Be warned that the author may not have intended to support it.
should
auto should(E expr)
Undocumented in source. Be warned that the author may not have intended to support it.
shouldApproxEqual
void shouldApproxEqual(V value, E expected, double maxRelDiff, double maxAbsDiff, string file, size_t line)

Assert that value is approximately equal to expected.

shouldBeEmpty
void shouldBeEmpty(R rng, string file, size_t line)

assert that rng is empty.

shouldBeFalse
void shouldBeFalse(E condition, string file, size_t line)

Throw if condition not false.

shouldBeGreaterThan
void shouldBeGreaterThan(T t, U u, string file, size_t line)

Assert that t should be greater than u.

shouldBeIn
void shouldBeIn(T value, U container, string file, size_t line)

Assert that value is in container.

shouldBeNull
void shouldBeNull(T value, string file, size_t line)

Assert value is null.

shouldBeSameJsonAs
void shouldBeSameJsonAs(string actual, string expected, string file, size_t line)

Assert that actual and expected represent the same JSON (i.e. formatting doesn't matter)

shouldBeSameSetAs
void shouldBeSameSetAs(V value, E expected, string file, size_t line)

Assert that value is the same set as expected (i.e. order doesn't matter)

shouldBeSmallerThan
void shouldBeSmallerThan(T t, U u, string file, size_t line)

Assert that t should be smaller than u.

shouldBeTrue
void shouldBeTrue(E condition, string file, size_t line)

Throw if condition is not true.

shouldEqual
void shouldEqual(V value, E expected, string file, size_t line)

Assert value is equal to expected

shouldNotBeEmpty
void shouldNotBeEmpty(R rng, string file, size_t line)

Assert that rng is not empty.

shouldNotBeIn
void shouldNotBeIn(T value, U container, string file, size_t line)

Assert value is not in container.

shouldNotBeNull
void shouldNotBeNull(T value, string file, size_t line)

Assert value is not null

shouldNotBeSameSetAs
void shouldNotBeSameSetAs(V value, E expected, string file, size_t line)

Assert that value is not the same set as expected.

shouldNotEqual
void shouldNotEqual(V value, E expected, string file, size_t line)

Assert value is not equal to expected.

shouldNotThrow
void shouldNotThrow(E expr, string file, size_t line)

Assert that expr doesn't throw

shouldThrow
void shouldThrow(E expr, string file, size_t line)

Assert that expr throws.

shouldThrowExactly
void shouldThrowExactly(E expr, string file, size_t line)

Assert that expr throws an Exception that must have the type E, derived types won't do.

shouldThrowWithMessage
void shouldThrowWithMessage(E expr, string msg, string file, size_t line)

Assert that expr throws and the exception message is msg.

writelnUt
void writelnUt(T args)

No-op version of writelnUt

Interfaces

Output
interface Output

Generic output interface

Mixin templates

runTestsMain
mixintemplate runTestsMain(Modules...)

Dummy version so "normal" code compiles

Meta