add external vm/matrix tests

This commit is contained in:
onyx-and-iris 2024-11-03 15:47:03 +00:00
parent 6c53cfa383
commit 0852b61eea
3 changed files with 49 additions and 0 deletions

4
testdata/matrix.txt vendored Normal file
View 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
View 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
View 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)
}