testing#
The testing module simplifies writing and running tests in an ad-hoc fashion.
- type
One -
This type is used for discovering leaks and double frees. It holds an integer value as well as a pointer to a single reference on the heap which is 1 as long as the object exists, otherwise 0. The refcount is leaked in order to not cause segfaults when a double free occurs.
In addition, a global refcounter is updated which can be checked for balance.
- inline
__!=( cls T ) - inline
__<( cls T ) - inline
__<=( cls T ) - inline
__==( cls T ) - inline
__>( cls T ) - inline
__>=( cls T ) - fn
__copy( self ) - fn
__drop( self ) - fn
__repr( self ) - inline
__typecall( cls value ) - fn
check( self ) - fn
refcount() - fn
reset-refcount() - fn
test-refcount-balanced() - fn
value( self )
- inline
- sugar (
features... ) -
A feature matrix that tests 2-d permutations
Usage:
features B1 B2 B3 ... --- A1 Y N Y A2 N Y N A3 Y N QWill expand to:
do Y A1 B1; N A1 B2; Y A1 B3 N A2 B1; Y A2 B2; N A2 B3 Y A3 B1; N A3 B2; Q A3 B3 - sugar (
test... ) - sugar (
test-compiler-error... ) - sugar (
test-error... ) - sugar (
test-modules... )