Skip to content

UT.AssertTrue

boxgaming edited this page Jul 11, 2026 · 1 revision

Used to verify that a given condition is true. If not, an error is thrown and execution is stopped.
The line containing the assertion error will be shown in the console output.
Available in release 0.11.0

Syntax

UT.AssertTrue value

Parameters

  • The value parameter contains the variable or expression to test.

Example

Import UT From "lib/test/unit-test.bas"

Dim i As Integer
i = 23

UT.AssertTrue i < 23
UT.AssertTrue i > 30

Output

ERROR : 7 : false is not true
    Error: false is not true
        at Object.sub_AssertTrue (eval at _runProgram (http://localhost:8080/qbjs-ide.js:434:26), <anonymous>:27:29)
        at main (eval at _runProgram (http://localhost:8080/qbjs-ide.js:434:26), <anonymous>:58:13)
        at async eval (eval at _runProgram (http://localhost:8080/qbjs-ide.js:434:26), <anonymous>:61:3)
        at async Object._runProgram [as runProgram] (http://localhost:8080/qbjs-ide.js:435:13)

See Also

UT.AssertFalse
UT.AssertEquals

Clone this wiki locally