mirror of
https://github.com/onyx-and-iris/vbantxt.git
synced 2024-12-04 15:50:47 +00:00
add external vm/matrix tests
This commit is contained in:
parent
6c53cfa383
commit
0852b61eea
4
testdata/matrix.txt
vendored
Normal file
4
testdata/matrix.txt
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Point(ASIO128.IN[1..4],ASIO128.OUT[1]).dBGain = -3
|
||||||
|
Point(ASIO128.IN[1..4],ASIO128.OUT[2]).dBGain = -3
|
||||||
|
Point(ASIO128.IN[1..4],ASIO128.OUT[1]).Mute = 1
|
||||||
|
Point(ASIO128.IN[1..4],ASIO128.OUT[2]).Mute = 1
|
3
testdata/vm.txt
vendored
Normal file
3
testdata/vm.txt
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
strip[0].mute=1;strip[0].mono=0
|
||||||
|
strip[1].mute=0;strip[1].mono=1
|
||||||
|
bus[3].eq.On=0
|
42
vbantxt_test.go
Normal file
42
vbantxt_test.go
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package vbantxt_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"bytes"
|
||||||
|
_ "embed"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/onyx-and-iris/vbantxt"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed testdata/vm.txt
|
||||||
|
var vm []byte
|
||||||
|
|
||||||
|
//go:embed testdata/matrix.txt
|
||||||
|
var matrix []byte
|
||||||
|
|
||||||
|
func run(t *testing.T, client *vbantxt.VbanTxt, script []byte) {
|
||||||
|
t.Helper()
|
||||||
|
|
||||||
|
r := bytes.NewReader(script)
|
||||||
|
scanner := bufio.NewScanner(r)
|
||||||
|
for scanner.Scan() {
|
||||||
|
err := client.Send(scanner.Text())
|
||||||
|
require.NoError(t, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSendVm(t *testing.T) {
|
||||||
|
client, err := vbantxt.New("vm.local", 6980, "onyx")
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
run(t, client, vm)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSendMatrix(t *testing.T) {
|
||||||
|
client, err := vbantxt.New("vm.local", 6990, "onyx")
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
run(t, client, matrix)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user