printj/ctest/fakeassert.js

5 lines
252 B
JavaScript
Raw Normal View History

2016-10-14 05:24:43 +00:00
var assert = {};
assert.equal = function(x,y) { if(x !== y) throw new Error(x + " !== " + y); };
assert.throws = function(f) { try { f(); } catch(e) { return; } throw new Error("Function did not fail"); };
assert.doesNotThrow = function(f) { f(); };