feat(poortf): add concept of 'author' to an imp of a TF

And make it so that if the same author adds imps again, they replace
  the previous imps from that author.

  Use this feature to avoid the explicit check for double-inclusion in
  subtract, and test it worked.
This commit is contained in:
Glen Whitney 2022-03-25 11:31:06 -07:00
parent 2c1b6c3364
commit 00a7f79552
4 changed files with 34 additions and 13 deletions

View file

@ -20,4 +20,8 @@ describe('The default full picomath instance "math"', () => {
math.complex(11, -4))
assert.deepStrictEqual(math.negate(math.complex(3, '8')).im, -8)
})
it('does not double-define subtract', () => {
assert.deepStrictEqual(math.subtract.imps.length, 1)
})
})