diff --git a/src/generic/subtract.concrete.mjs b/src/generic/subtract.concrete.mjs new file mode 100644 index 0000000..39638aa --- /dev/null +++ b/src/generic/subtract.concrete.mjs @@ -0,0 +1,3 @@ +export {subtract} from './subtract.mjs' +export * from '../number/add.mjs' +export * from '../number/negate.mjs' diff --git a/test/custom.mjs b/test/custom.mjs index aabbb8c..72ba2d0 100644 --- a/test/custom.mjs +++ b/test/custom.mjs @@ -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) + }) })