From c1c514dd8e6a9dfefb4ac540da03a67d8156a4d3 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 3 Oct 2023 11:20:47 +0100 Subject: [PATCH] test(js-checkpoint): add test to less exercise --- js/tests/less_test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 js/tests/less_test.js diff --git a/js/tests/less_test.js b/js/tests/less_test.js new file mode 100644 index 000000000..bd5f30dd1 --- /dev/null +++ b/js/tests/less_test.js @@ -0,0 +1,15 @@ +export const tests = [] +const t = (f) => tests.push(f) + +t(() => typeof less === 'function') +t(() => less.length === 1) + +t(() => less(5) === 4) +t(() => less(1) === 0) +t(() => less(0) === -1) +t(() => less(-1) === -2) + +const rand = Math.random() +t(() => less(rand) === rand - 1) + +Object.freeze(tests) \ No newline at end of file