feat: A module that supplies subtract and its dependencies (for numbers)

This commit is contained in:
Glen Whitney 2022-07-22 18:56:31 -07:00
parent 2a60cc0989
commit 0fba6544b4
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,3 @@
export {subtract} from './subtract.mjs'
export * from '../number/add.mjs'
export * from '../number/negate.mjs'

View File

@ -6,6 +6,7 @@ import * as numberAdd from '../src/number/add.mjs'
import * as complex from '../src/complex/all.mjs'
import * as complexAdd from '../src/complex/add.mjs'
import * as complexNegate from '../src/complex/negate.mjs'
import * as concreteSubtract from '../src/generic/subtract.concrete.mjs'
import extendToComplex from '../src/complex/extendToComplex.mjs'
const bw = new PocomathInstance('backwards')
@ -55,4 +56,10 @@ describe('A custom instance', () => {
assert.strictEqual('subtract' in cherry, false)
assert.strictEqual('negate' in cherry, false)
})
it("can use bundles that are closed under dependency", () => {
const ok = new PocomathInstance('concrete')
ok.install(concreteSubtract)
assert.strictEqual(ok.subtract(7, 5), 2)
})
})