add test for color type

This commit is contained in:
2024-10-13 16:39:31 -05:00
parent 2716ccc349
commit 13a8334504
2 changed files with 10 additions and 0 deletions
@@ -38,6 +38,11 @@ const tests = [
bytes: new Uint8Array([47, 104, 101, 108, 108, 111, 0, 0, 44, 70, 0, 0]),
expected: { address: '/hello', args: [{ type: 'F', value: false }] },
},
{
description: 'simple address color arg',
bytes: new Uint8Array([47, 104, 101, 108, 108, 111, 0, 0, 44, 114, 0, 0, 20, 21, 22, 10]),
expected: { address: '/hello', args: [{ type: 'r', value: { r: 20, g: 21, b: 22, a: 10 } }] },
},
{
description: 'osc 1.0 spec example 1',
bytes: new Uint8Array([
@@ -38,6 +38,11 @@ const tests = [
message: { address: '/hello', args: [{ type: 'F', value: false }] },
expected: new Uint8Array([47, 104, 101, 108, 108, 111, 0, 0, 44, 70, 0, 0]),
},
{
description: 'simple address color arg',
message: { address: '/hello', args: [{ type: 'r', value: { r: 20, g: 21, b: 22, a: 10 } }] },
expected: new Uint8Array([47, 104, 101, 108, 108, 111, 0, 0, 44, 114, 0, 0, 20, 21, 22, 10]),
},
{
description: 'osc 1.0 spec example 1',
message: { address: '/oscillator/4/frequency', args: [{ type: 'f', value: 440 }] },