From 9cdabe4ec34ce0e63a67419868f489791d38be5a Mon Sep 17 00:00:00 2001 From: Sema Date: Fri, 15 Mar 2024 00:31:50 -0400 Subject: [PATCH] Coverage --- javascript/JZZ.js | 12 ++++++------ test/common.js | 10 ++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/javascript/JZZ.js b/javascript/JZZ.js index ca328d0..17c296f 100644 --- a/javascript/JZZ.js +++ b/javascript/JZZ.js @@ -2773,13 +2773,13 @@ mmm = new MIDI([0xf0].concat(a, [0xf7])); this._cc[kk].sx = undefined; } - else if (st == 1) { + if (st == 1) { this._cc[kk].sx = a; } - else if (st == 2) { + if (st == 2) { if (this._cc[kk].sx) this._cc[kk].sx = this._cc[kk].sx.concat(a); } - else if (st == 3) { + if (st == 3) { if (this._cc[kk].sx) { a = this._cc[kk].sx.concat(a); mmm = new MIDI([0xf0].concat(a, [0xf7])); @@ -2812,13 +2812,13 @@ msg.label(_m2_str(a)); this._cc[kk].tx = undefined; } - else if (st == 1) { + if (st == 1) { this._cc[kk].tx = a; } - else if (st == 2) { + if (st == 2) { if (this._cc[kk].tx) this._cc[kk].tx = this._cc[kk].tx.concat(a); } - else if (st == 3) { + if (st == 3) { if (this._cc[kk].tx) { a = this._cc[kk].tx.concat(a); msg.label(_m2_str(a)); diff --git a/test/common.js b/test/common.js index 7abc86c..3075b7f 100644 --- a/test/common.js +++ b/test/common.js @@ -2020,6 +2020,16 @@ describe('JZZ.Context', function() { msg = JZZ.MIDI2.umpCText(2, 3, '𝄞'); ctxt._receive(msg[0]); assert.equal(msg[0].toString(), 'd2030200 eda0b4ed b49e0000 00000000 -- Text (𝄞)'); + msg = JZZ.MIDI2.umpText(1, '𝄞 𝄞 MIDI 𝄞 𝄞'); + ctxt._receive(msg[1]); + assert.equal(msg[1].toString(), 'd1900200 9e204d49 444920ed a0b4edb4 -- Text'); + ctxt._receive(msg[2]); + assert.equal(msg[2].toString(), 'd1d00200 9e20eda0 b4edb49e 00000000 -- Text'); + ctxt._receive(msg[0]); + assert.equal(msg[0].toString(), 'd1500200 eda0b4ed b49e20ed a0b4edb4 -- Text'); + ctxt._receive(msg[1]); + ctxt._receive(msg[2]); + assert.equal(msg[2].toString(), 'd1d00200 9e20eda0 b4edb49e 00000000 -- Text (𝄞 𝄞 MIDI 𝄞 𝄞)'); }); it('noop', function() { var ctxt = JZZ.Context();