index Zimbu documentation

MODULE CHECK @public

summary

     

Methods for runtime checks.

true(actual, msg) @public  Throws an exception when actual is FALSE.
false(actual, msg) @public  Throws an exception when actual is TRUE.
notNil<Tp>(p, msg) @public  Throws an exception when p is NIL
isNil<Tp>(p, msg) @public  Throws an exception when p is not NIL
notEmpty(p, msg) @public  Throws an exception when p is an empty string.
equal(expected, actual, msg) @public  Throws an exception when expected and actual are not equal.
equal(expected, actual, msg) @public  Throws an exception when expected and actual are not equal.
equal(expected, actual, msg) @public  Throws an exception when expected and actual are not equal.
equalShort(expected, actual, msg) @public  Throws an exception when expected and actual are not equal.
equal(expected, actual, msg) @public  Throws an exception when expected and actual are not equal.
equal(expected, actual, msg) @public  Throws an exception when expected and actual are not equal.
equal(expected, actual, msg) @public  Throws an exception when expected and actual are not equal.
inRange(n, min, max, msg) @public  Throws an exception when n < min and when n > max.
 

members (alphabetically)

     

PROC equal(int expected, int actual, string msg) @public

     

Throws an exception when expected and actual are not equal.

Adds msg to the exception message if it is present and not NIL.

PROC equal(nat expected, nat actual, string msg) @public

     

Throws an exception when expected and actual are not equal.

Adds msg to the exception message if it is present and not NIL.

PROC equal(string expected, string actual, string msg) @public

     

Throws an exception when expected and actual are not equal.

Adds msg to the exception message if it is present and not NIL.

The exception message has the full text of expected and actual.

PROC equal(bool expected, bool actual, string msg) @public

     

Throws an exception when expected and actual are not equal.

Adds msg to the exception message if it is present and not NIL.

PROC equal(status expected, status actual, string msg) @public

     

Throws an exception when expected and actual are not equal.

Adds msg to the exception message if it is present and not NIL.

PROC equal(dyn expected, dyn actual, string msg) @public

     

Throws an exception when expected and actual are not equal.

Both the types and the values must be equal.

Adds msg to the exception message if it is present and not NIL.

PROC equalShort(string expected, string actual, string msg) @public

     

Throws an exception when expected and actual are not equal.

Adds msg to the exception message if it is present and not NIL.

The message has a shortened difference instead of the full text, with square brackets indicating the difference.

PROC false(bool actual, string msg) @public

     

Throws an exception when actual is TRUE.

Adds msg to the exception message if it is present and not NIL.

Examples:

    CHECK.false(value > 0)
    CHECK.false(hasWord())
    CHECK.false(hasWord(), "word should not be there")

PROC inRange(int n, int min, int max, string msg) @public

     

Throws an exception when n < min and when n > max.

Adds msg to the exception message if it is present and not NIL.

PROC isNil<Tp>(Tp p, string msg) @public

     

Throws an exception when p is not NIL

Adds msg to the exception message if it is present and not NIL.

PROC notEmpty(string p, string msg) @public

     

Throws an exception when p is an empty string.

Adds msg to the exception message if it is present and not NIL. Also checks for a NIL value of p.

PROC notNil<Tp>(Tp p, string msg) @public

     

Throws an exception when p is NIL

Adds msg to the exception message if it is present and not NIL.

PROC true(bool actual, string msg) @public

     

Throws an exception when actual is FALSE.

Adds msg to the exception message if it is present and not NIL.

Examples:

    CHECK.true(value > 0)
    CHECK.true(hasWord())
    CHECK.true(hasWord(), "word should be there")

license

      Copyright 2009 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0