Annotation: assert.is_less_than

CREATE OR REPLACE FUNCTION assert.is_less_than(x anyelement, y anyelement, OUT message text, OUT result boolean)
RETURNS record

Information: assert.is_less_than

Schema assert
Function Name is_less_than
Arguments x anyelement, y anyelement, OUT message text, OUT result boolean
Owner postgres
Result Type record
Description

Implementation: assert.is_less_than

CREATE OR REPLACE FUNCTION assert.is_less_than(x anyelement, y anyelement, OUT message text, OUT result boolean)
 RETURNS record
 LANGUAGE plpgsql
 IMMUTABLE STRICT
AS $function$
BEGIN
    IF($1 < $2) THEN
        message := 'Assert less than condition is satisfied.';
        PERFORM assert.ok(message);
        result := true;
        RETURN;
    END IF;
    
    message := E'ASSERT IS_LESS_THAN FAILED.\n\n X : -> ' || $1::text || E'\n is not  than Y:   -> ' || $2::text || E'\n';  
    PERFORM assert.fail(message);
    result := false;
    RETURN;
END
$function$