diff options
Diffstat (limited to 'tests/test.js')
-rw-r--r-- | tests/test.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test.js b/tests/test.js index 4bb7f60..9269328 100644 --- a/tests/test.js +++ b/tests/test.js @@ -72,4 +72,18 @@ if (TEST_JS_LOADED == undefined) { compare(editor.currentColumn(), column, message) } + function assert(cond, message) { + if ( verbose ) { + if ( message != undefined ) + console.log("assert(" + message + "): " + cond) + else + console.log("assert: " + cond) + } + if ( !cond ) { + if ( message != undefined ) + error("Assertion failed: " + message) + else + error("Assertion failed") + } + } } |