Wurstunit

Core Language View source
Wurstunit

Source on GitHub

📖 Read the detailed guide for hand-written examples and background.

Functions

test

public function test()

Functions annotated with @Test can be executed as unit tests.

println

public function println(string msg)

testFail

public function testFail(string msg)

testSuccess

public function testSuccess()

assertTrue

public function assertTrue(boolean b)

Asserts that this booleans is true. If it is not, an error is thrown.

assertTrue

public function assertTrue(boolean b, string msg)

Asserts that this booleans is true. If it is not, an error is thrown with the supplied message.

assertNotNull

public function assertNotNull<T>(T t)

Asserts that the reference t is not null

Extension Functions

int.assertEquals

public function int.assertEquals(int expected)

Asserts that two ints are equal. If they are not, an error is thrown with a message.

int.assertGreaterThan

public function int.assertGreaterThan(int less)

Asserts that the passed int is greater than the parameter. If they are not, an error is thrown with a message.

int.assertGreaterThanOrEqual

public function int.assertGreaterThanOrEqual(int less)

Asserts that the passed int is greater than the parameter. If they are not, an error is thrown with a message.

int.assertLessThan

public function int.assertLessThan(int greater)

Asserts that the passed int is greater than the parameter. If they are not, an error is thrown with a message.

int.assertLessThanOrEqual

public function int.assertLessThanOrEqual(int greater)

Asserts that the passed int is greater than the parameter. If they are not, an error is thrown with a message.

string.assertEquals

public function string.assertEquals(string expected)

Asserts that two strings are equal. If they are not, an error is thrown with a message.

real.assertEquals

public function real.assertEquals(real expected)

Asserts that two reals are equal. If they are not, an error is thrown with a message.

real.assertGreaterThan

public function real.assertGreaterThan(real less)

Asserts that the passed real is greater than the parameter. If they are not, an error is thrown with a message.

real.assertGreaterThanOrEqual

public function real.assertGreaterThanOrEqual(real less)

Asserts that the passed real is greater than the parameter. If they are not, an error is thrown with a message.

real.assertLessThan

public function real.assertLessThan(real greater)

Asserts that the passed real is greater than the parameter. If they are not, an error is thrown with a message.

real.assertLessThanOrEqual

public function real.assertLessThanOrEqual(real greater)

Asserts that the passed real is greater than the parameter. If they are not, an error is thrown with a message.

real.assertEquals

public function real.assertEquals(real expected, real delta)

Asserts that two reals are equal to within a positive delta. If they are not, an error is thrown with a message.

boolean.assertEquals

public function boolean.assertEquals(boolean expected)

Asserts that two booleans are equal. If they are not, an error is thrown with a message.

boolean.assertTrue

public function boolean.assertTrue()

Asserts that this booleans is true. If it is not, an error is thrown with a message.

boolean.assertFalse

public function boolean.assertFalse()

Asserts that this booleans is false. If it is not, an error is thrown with a message.