test(js-checkpoint): add test to less exercise

This commit is contained in:
root 2023-10-03 11:20:47 +01:00
parent 543f309348
commit c1c514dd8e
1 changed files with 15 additions and 0 deletions

15
js/tests/less_test.js Normal file
View File

@ -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)