diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-12-04 02:27:45 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-12-04 02:29:27 +0900 |
| commit | 69b1131d6622108f37c85014035f71cf4f2986e5 (patch) | |
| tree | 368cc8d0659d9925c9df8153398ca5038313e160 /internal/pipewire/spa_test.go | |
| parent | 2c0b92771a95693af7f14a70ddeddc5371e73996 (diff) | |
internal/pipewire: use type name in error strings
This provides more useful messages for protocol errors.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire/spa_test.go')
| -rw-r--r-- | internal/pipewire/spa_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/pipewire/spa_test.go b/internal/pipewire/spa_test.go index 6bf7794b..0a7d79aa 100644 --- a/internal/pipewire/spa_test.go +++ b/internal/pipewire/spa_test.go @@ -3,10 +3,32 @@ package pipewire_test import ( _ "embed" "encoding/binary" + "testing" "hakurei.app/internal/pipewire" ) +func TestSPAKind(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + v pipewire.SPAKind + want string + }{ + {"invalid", 0xdeadbeef, "invalid type field 0xdeadbeef"}, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + if got := tc.v.String(); got != tc.want { + t.Errorf("String: %q, want %q", got, tc.want) + } + }) + } +} + // splitMessages splits concatenated messages into groups of // header, payload, footer of each individual message. // splitMessages panics on any decoding error. |
