Assert

From GECK
Jump to: navigation, search


A function added by the New Vegas Script Extender version 6.2.7.

Description

A debugging function to make test assertions, usually to verify if a function is properly functioning so as to catch bugs and regressions in code.

If assertion is false, will print an error message and show the script line that isn't working in console.

Syntax

[help]
(none) Assert assertion:bool

Example

 ;* From xNVSE's unit tests: test if ar_Erase properly erases all entries
 array_var aVar = ar_list 1 2 3 4
 ar_Erase aVar
 Assert (ar_Size aVar) == 0

See Also