Skip to content
binodnp edited this page Aug 14, 2014 · 2 revisions

Should be placed at the end of a test function's body to propose that the test passed.

Annotation

CREATE FUNCTION assert.ok(message text)
RETURNS text

Parameters

Parameter Parameter Name Data Type Description
$1 message text A message to be displayed in the end of each test. If displayed means the test passed.

Example

The following function is an empty test.

DROP FUNCTION IF EXISTS unit_tests.assert_ok_example();

CREATE FUNCTION unit_tests.assert_ok_example()
RETURNS test_result
AS
$$
DECLARE message test_result;
BEGIN		
	SELECT assert.ok('End of test.') INTO message;  
	RETURN message; 
END
$$
LANGUAGE plpgsql;

##See Also

assert.pass(text)

Clone this wiki locally