add filter/input/version tests

This commit is contained in:
2025-05-26 19:49:51 +01:00
parent f58b2dfeab
commit 3deb03cf32
3 changed files with 246 additions and 0 deletions

30
version_test.go Normal file
View File

@@ -0,0 +1,30 @@
package main
import (
"bytes"
"strings"
"testing"
)
func TestVersion(t *testing.T) {
client, disconnect := getClient(t)
defer disconnect()
var out bytes.Buffer
context := &context{
Client: client,
Out: &out,
}
cmd := &VersionCmd{}
err := cmd.Run(context)
if err != nil {
t.Fatalf("Failed to get version: %v", err)
}
if !strings.Contains(out.String(), "OBS Client Version:") {
t.Fatalf("Expected output to contain 'OBS Client Version:', got '%s'", out.String())
}
if !strings.Contains(out.String(), "with Websocket Version:") {
t.Fatalf("Expected output to contain 'with Websocket Version:', got '%s'", out.String())
}
}