test div and mul

This commit is contained in:
alex 2022-02-23 22:46:01 +00:00
parent ef877a40ca
commit fb149808ee

View File

@ -80,6 +80,16 @@ describe('Pattern', function() {
assert.equal(pure(3).sub(pure(4)).query(new TimeSpan(Fraction(0), Fraction(1)))[0].value, -1)
})
})
describe('mul()', function () {
it('Can multiply things', function() {
assert.equal(pure(3).mul(pure(2)).firstCycle[0].value, 6)
})
})
describe('div()', function () {
it('Can divide things', function() {
assert.equal(pure(3).div(pure(2)).firstCycle[0].value, 1.5)
})
})
describe('union()', function () {
it('Can union things', function () {
assert.deepStrictEqual(pure({a: 4, b: 6}).union(pure({c: 7})).firstCycle[0].value, {a: 4, b: 6, c: 7})