From 5efc7885e1c3959aa165be640858ffb3f8a5860b Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 31 May 2022 20:52:15 -0500 Subject: refactor: remove modules/ folder --- src/test-assert.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/test-assert.js (limited to 'src/test-assert.js') diff --git a/src/test-assert.js b/src/test-assert.js new file mode 100644 index 0000000..7be2989 --- /dev/null +++ b/src/test-assert.js @@ -0,0 +1,21 @@ +import { strict as assert } from 'node:assert'; + +function test(description, func) +{ + process.stdout.write(description); + let error = null; + try { + func(); + } + catch(err) { + error = err; + } + + if (error) { + console.log(' - FAIL'); + console.log(error); + } + else console.log(' - OK'); +} + +export { test, assert }; -- cgit v1.2.1