com.livecode.unittest

Typemodule
DictionaryLCB
LibraryLiveCode Builder
Associationscom.livecode.unittest
Summary

This library provides syntax for unit testing LiveCode Builder programs. It is used by the LiveCode Builder standard library's testsuite.

To use this library, write your tests in a Builder source code file. Each group of tests should be a public handler with a name beginning with Test. If possible, use one test per handler. Otherwise, add a plan N tests statement at the start of the handler.

Example
public handler TestSelf()
	plan 10 tests

	test diagnostic "Normal tests"
	test 2 > 1
	test "Basic test" when true

	test diagnostic "Skipped tests"
	skip test
	skip test "Skipped 2"
	skip test because "Not implemented"
	skip test "Skipped 4" because "Not supported on this platform"

	test diagnostic "Tests which are expected to fail"
	broken test false
	broken test "Failed 2" when false
	broken test false because "broken"
	broken test "Failed 4" when false because "really broken"
end handler

The test results are output on standard output in TAP (Test Anything
Protocol) format.
Description

This library provides syntax for unit testing LiveCode Builder programs. It is used by the LiveCode Builder standard library's testsuite.

To use this library, write your tests in a Builder source code file. Each group of tests should be a public handler with a name beginning with Test. If possible, use one test per handler. Otherwise, add a plan N tests statement at the start of the handler.

TypeNameSummarySyntax
modulecom.livecode.unittest

This library provides syntax for unit testing LiveCode Builder programs. It is used by the LiveCode Builder standard library's testsuite.

To use this library, write your tests in a Builder source code file. Each group of tests should be a public handler with a name beginning with Test. If possible, use one test per handler. Otherwise, add a plan N tests statement at the start of the handler.

statementUnitDiagnostic

Log unit test diagnostic message.

test diagnostic <Message>

- - -UnitPlan

Announce how many test results are expected from the unit test.

plan <Count> tests

- - -UnitTest

Make a unit test assertion

test <Condition>

- - -UnitTestDescription

Make a unit test assertion with a description

test <Description> when <Condition>

- - -UnitTestFails

Make a failing unit test assertion

broken test <Condition>

- - -UnitTestFailsDescription

Make a failing unit test assertion with a description

broken test <Description> when <Condition>

- - -UnitTestFailsDescriptionAndReason

Make a failing unit test assertion with a reason for brokenness

broken test <Description> when <Condition> because <Reason>

- - -UnitTestFailsReason

Make a failing unit test assertion with a reason for brokenness

broken test <Condition> because <Reason>

- - -UnitTestSkip

Record a skipped test

skip test

- - -UnitTestSkipDescription

Record a skipped test with a description

skip test <Description>

- - -UnitTestSkipDescriptionAndReason

Record a skipped test with a test description and reason for skipping

skip test <Description> because <Reason>

- - -UnitTestSkipReason

Record a skipped test with a reason for skipping

skip test because <Reason>