Testing Library


The Testing Library contains many different run-time assertions and a framework for creating, running, and displaying testing results.


Defined in module <cmoon.test>

Core


test_result The result of running a test
(class)
test_case Abstract class of an invocable test
(class)
test_suite Class to store multiple test cases
(class)

Runners


text_test_runner Runs tests with text output to a stream
(class template)

Assertions


assert_exception Exception used in a failed assertion
(class)
fail Immediately throws an assert_exception with a message
(function)
error Immediately throws a std::runtime_error with a message
(function)
assert_equal Asserts that the first argument is equal to the second argument
(function template)
assert_not_equal Asserts that the first argument is not equal to the second argument
(function template)
assert_true Asserts that the first argument is equivalent to true
(function template)
assert_false Asserts that the first argument is equivalent to false
(function template)
assert_is Asserts that the first argument is the same object as the second argument
(function template)
assert_is_not Asserts that the first argument is not the same object as the second argument
(function template)
assert_is_type Asserts that the first templated type is the same as the second templated type
(function template)
assert_is_not_type Asserts that the first templated type is not the same as the second templated type
(function template)
assert_is_specialization_of Asserts that the first templated type is a specialization of the second incomplete type
(function template)
assert_is_not_specialization_of Asserts that the first templated type is not a specialization of the second incomplete type
(function template)
assert_is_instance Asserts that the given object can be casted as the given templated type
(function template)
assert_is_not_instance Asserts that the given object cannot be casted as the given templated type
(function template)
assert_in Asserts that the given object can be found in the given range
(function template)
assert_not_in Asserts that the given object cannot be found in the given range
(function template)
assert_throws Asserts that the given callable object throws the given type as an exception
(function template)
assert_almost_equal Asserts that the difference between the first two arguments are less than the given delta
(function template)
assert_not_almost_equal Asserts that the difference between the first two arguments are greater than or equal to the given delta
(function template)
assert_greater Asserts that the first argument is greater than the second argument
(function template)
assert_greater_equal Asserts that the first argument is greater than or equal to the second argument
(function template)
assert_less Asserts that the first argument is lesser than the second argument
(function template)
assert_less_equal Asserts that the first argument is less than or equal to the second argument
(function template)
assert_sequence_equal Asserts that the first sequence is equal to the second sequence
(function template)
assert_sequence_not_equal Asserts that the two sequences are not equal
(function template)
assert_sequence_almost_equal Asserts that the difference between corresponding elements in each sequence is not greater than the given delta
(function template)
assert_sequence_not_almost_equal Asserts that the difference between an element in each sequence is greater than the given delta
(function template)