Annotation: unit_tests.if_functions_compile

CREATE OR REPLACE FUNCTION unit_tests.if_functions_compile()
RETURNS test_result

Information: unit_tests.if_functions_compile

Schema unit_tests
Function Name if_functions_compile
Arguments
Owner postgres
Result Type test_result
Description

Implementation: unit_tests.if_functions_compile

CREATE OR REPLACE FUNCTION unit_tests.if_functions_compile()
 RETURNS test_result
 LANGUAGE plpgsql
AS $function$
    DECLARE schemas text[];
    DECLARE message test_result;
    DECLARE result  boolean;
BEGIN

    schemas := ARRAY(
                SELECT nspname::text
                FROM pg_namespace
                WHERE nspname NOT LIKE 'pg%'
                AND nspname NOT IN('assert', 'unit_tests', 'information_schema')
                ORDER BY nspname
                );


    SELECT * FROM assert.if_functions_compile(VARIADIC schemas) INTO message, result;
    
    IF(result=false) THEN
        RETURN message;
    END IF;

    SELECT assert.ok('End of test.') INTO message;  
    RETURN message; 
END
$function$