aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pipewire/pod_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pipewire/pod_test.go')
-rw-r--r--internal/pipewire/pod_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/pipewire/pod_test.go b/internal/pipewire/pod_test.go
index a39f9614..28e789f5 100644
--- a/internal/pipewire/pod_test.go
+++ b/internal/pipewire/pod_test.go
@@ -5,11 +5,14 @@ import (
"encoding/json"
"reflect"
"testing"
+
+ "hakurei.app/internal/pipewire"
)
type encodingTestCases[V any, S interface {
encoding.BinaryMarshaler
encoding.BinaryUnmarshaler
+
*V
}] []struct {
// Uninterpreted name of subtest.
@@ -51,6 +54,14 @@ func (testCases encodingTestCases[V, S]) run(t *testing.T) {
t.Fatalf("MarshalBinary: %#v, want %#v", gotData, tc.wantData)
}
})
+
+ if s, ok := any(&tc.value).(pipewire.KnownSize); ok {
+ t.Run("size", func(t *testing.T) {
+ if got := int(s.Size()); got != len(tc.wantData) {
+ t.Errorf("Size: %d, want %d", got, len(tc.wantData))
+ }
+ })
+ }
})
}
}