-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add `testMicrotones` in `convert_nn_to_freq.test.js` - Add receive_mpe.test.js
- Loading branch information
Showing
6 changed files
with
235 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const { assert } = require('chai'); | ||
|
||
module.exports = { | ||
// Name of the patcher which you want to test | ||
target: 'receive_mpe', | ||
|
||
// `initPatcher` will be executed just before each test function. | ||
initPatcher: function*(maxAPI) { | ||
maxAPI.outlet({ | ||
send_mpe: { inlet1: 8888 }, | ||
receive_mpe: { inlet0: 8888 } | ||
}); | ||
setTimeout(() => { | ||
maxAPI.outlet({ send_mpe: { inlet0: 1 } }); | ||
}, 50); | ||
assert.notEqual(yield, null, 'isOk'); | ||
}, | ||
|
||
// The key of each test generator function should start with 'test' | ||
testReceiveNumber: function*(maxAPI) { | ||
maxAPI.outlet({ | ||
send_mpe: { inlet0: 178 } | ||
}); | ||
assert.deepEqual(yield, { outlet0: 178 }, 'natural number'); | ||
maxAPI.outlet({ | ||
send_mpe: { inlet1: 145 }, | ||
receive_mpe: { inlet0: 145 } | ||
}); | ||
setTimeout(() => { | ||
maxAPI.outlet({ send_mpe: { inlet0: -78.5 } }); | ||
}, 50); | ||
assert.deepEqual(yield, { outlet0: -78.5 }, 'negative float'); | ||
}, | ||
testReceiveContinuously: function*(maxAPI) { | ||
for (let i = 0; i < 3000; i++) { | ||
maxAPI.outlet({ | ||
send_mpe: { inlet0: i } | ||
}); | ||
assert.deepEqual(yield, { outlet0: i }); | ||
} | ||
}, | ||
testReceiveList: function*(maxAPI) { | ||
maxAPI.outlet({ | ||
send_mpe: { inlet1: 277 }, | ||
receive_mpe: { inlet0: 277 } | ||
}); | ||
setTimeout(() => { | ||
maxAPI.outlet({ send_mpe: { inlet0: [-0.3, 'hi', 5] } }); | ||
}, 50); | ||
assert.deepEqual( | ||
yield, | ||
{ outlet0: [-0.3, 'hi', 5] }, | ||
'list of mixed types' | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters