feat: Allow nonrecursive whole-function dependencies (#2)
And implement negate on numbers, and use dependencies to define subtract. Co-authored-by: Glen Whitney <glen@studioinfinity.org> Reviewed-on: #2
This commit is contained in:
parent
f5e2e09aa2
commit
b59a8c2ca9
6 changed files with 43 additions and 4 deletions
|
@ -2,9 +2,18 @@ import assert from 'assert'
|
|||
import math from '../pocomath.mjs'
|
||||
|
||||
describe('The default full pocomath instance "math"', () => {
|
||||
it('can subtract numbers', () => {
|
||||
assert.strictEqual(math.subtract(12, 5), 7)
|
||||
})
|
||||
|
||||
it('can add numbers', () => {
|
||||
assert.strictEqual(math.add(3, 4), 7)
|
||||
assert.strictEqual(math.add(1.5, 2.5, 3.5), 7.5)
|
||||
assert.strictEqual(math.add(Infinity), Infinity)
|
||||
})
|
||||
|
||||
it('can negate numbers', () => {
|
||||
assert.strictEqual(math.negate(-1), 1)
|
||||
assert.strictEqual(math.add(10, math.negate(3)), 7)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue