jsketcher/web/app/test-utils.js
Val Erastov 658f2220ee structs
2015-01-30 16:26:42 -08:00

16 lines
No EOL
369 B
JavaScript

function _test_utils_msg(msg) {
return (msg === undefined ? "" : "\n" + msg);
}
function assert(statement, msg) {
if (!statement) {
throw "ASSERTION ERROR." + _test_utils_msg(msg) ;
}
}
function assertEQ(expected, actual, msg) {
if ( expected !== actual ) {
throw "ASSERTION ERROR. \n Expected: " + a + ", Actual: " + b + _test_utils_msg(msg) ;
}
}