Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Feb 10, 2024
1 parent 5f097d4 commit 02b2acc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const TEST = require('test-midi-files');
- [**test-minimal.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-minimal.midi2)
- [**test-no-header.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-no-header.midi2)
- [**test-text-message.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-text-message.midi2)
- [**test-text-out-of-order.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-text-out-of-order.midi2)
- [**test-gm2-doggy-78-00-38-4c.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-gm2-doggy-78-00-38-4c.midi2)
- [**test-gm2-doggy-79-01-7b.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-gm2-doggy-79-01-7b.midi2)
- [**test-gs-doggy-01-00-7b.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-gs-doggy-01-00-7b.midi2)
Expand Down
22 changes: 22 additions & 0 deletions code2/test-text-out-of-order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var TEST = require('..');
var JZZ = require('jzz');
require('jzz-midi-smf')(JZZ);

var data = JZZ.UMP.umpMetadata(0, 'This is a 8-bit data that requires several UMP packets...');

var clip = new JZZ.MIDI.Clip();
clip.header
.umpClipName(0, 'MIDI2 out of order Data')
.umpCopyright(0, 'https:/jazz-soft.net')
.umpMetadata(0, 'Testing MIDI 2.0 out of order text messages');
clip
.umpMetadata(0, 'This file contains out of order text. Most likely, the player should ignore it.')
.send(data[4])
.send(data[3])
.send(data[2])
.send(data[1])
.send(data[0])
.umpMetadata(0, 'Thank you!');

TEST.write(clip);
TEST.play(clip);
Binary file added midi2/test-text-out-of-order.midi2
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"devDependencies": {
"eslint": "^8.56.0",
"grunt": "^1.6.1",
"mocha": "^10.2.0",
"mocha": "^10.3.0",
"nyc": "^15.1.0"
},
"runkitExampleFilename": "runkit.js",
Expand Down

0 comments on commit 02b2acc

Please sign in to comment.