⌂ Modules nupp nupp.test nupp.test
Assertions shared by Nupp's bundled test runner and project test suites.
Every failure names the values that differed. The functions return their successful input where that is useful, so an assertion may narrow or validate a value without forcing the caller to spell it twice.
Module contents Functions Function Kind Description assertfunction Requires a truthy value and returns its complete input pack. equalfunction Requires two values to be equal and returns the actual value. isSkipfunction Answers whether a caught error is a skip raised by this module. matchesfunction Requires a string value containing a Lua pattern and returns the string. notEqualfunction Requires two values to differ and returns the actual value. raisesfunction Requires a callback to raise and returns its error value. skipfunction Skips the current test case with a reason. skipReasonfunction Returns the reason carried by a skip error.
Functions
assertfunction
Requires a truthy value and returns its complete input pack.
Arguments Name Type Description valueany ...any
Returns
Raises
equalfunction
function equal ( actual : any , expected : any , message : string ? ) : any
Requires two values to be equal and returns the actual value.
Arguments Name Type Description actualany expectedany messagestring ?
Returns
Raises
isSkipfunction
Answers whether a caught error is a skip raised by this module.
Arguments Name Type Description valueany
Returns
matchesfunction
function matches ( value : any , pattern : string , message : string ? ) : string
Requires a string value containing a Lua pattern and returns the string.
Arguments Name Type Description valueany patternstring messagestring ?
Returns
Raises
notEqualfunction
function notEqual ( actual : any , unwanted : any , message : string ? ) : any
Requires two values to differ and returns the actual value.
Arguments Name Type Description actualany unwantedany messagestring ?
Returns
Raises
raisesfunction
function raises ( fn : function ( ... : any ) : any , pattern : string ? ) : any
Requires a callback to raise and returns its error value.
Arguments Name Type Description fnfunction ( ... : any ) : any patternstring ?
Returns
Raises
skipfunction
Skips the current test case with a reason.
Arguments Name Type Description reasonstring
Returns
skipReasonfunction
function skipReason ( value : any ) : string ?
Returns the reason carried by a skip error.
Arguments Name Type Description valueany
Returns
← Previous nupp.tasks Next → nupp.text