From 4ea6c8f11f163cf398e06b33dce8925e14cc7603 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sun, 8 Feb 2026 21:31:08 -0600 Subject: [PATCH] test cleanup --- internal/processor/string-decode_test.go | 3 +-- internal/processor/string-encode_test.go | 16 +++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/internal/processor/string-decode_test.go b/internal/processor/string-decode_test.go index b90251e..0223215 100644 --- a/internal/processor/string-decode_test.go +++ b/internal/processor/string-decode_test.go @@ -80,7 +80,6 @@ func TestBadStringDecode(t *testing.T) { errorString string }{ { - processor: &stringDecoder, name: "non-[]byte input", payload: "hello", errorString: "string.decode processor only accepts a []byte", @@ -89,7 +88,7 @@ func TestBadStringDecode(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - got, err := test.processor.Process(t.Context(), test.payload) + got, err := stringDecoder.Process(t.Context(), test.payload) if err == nil { t.Fatalf("string.decode expected to fail but got payload: %s", got) diff --git a/internal/processor/string-encode_test.go b/internal/processor/string-encode_test.go index 95c1c9a..5d40c0f 100644 --- a/internal/processor/string-encode_test.go +++ b/internal/processor/string-encode_test.go @@ -47,22 +47,20 @@ func TestStringEncodeFromRegistry(t *testing.T) { func TestGoodStringEncode(t *testing.T) { stringEncoder := processor.StringEncode{} tests := []struct { - processor processor.Processor - name string - payload any - expected []byte + name string + payload any + expected []byte }{ { - processor: &stringEncoder, - name: "hello", - payload: "hello", - expected: []byte{0x68, 0x65, 0x6c, 0x6c, 0x6f}, + name: "hello", + payload: "hello", + expected: []byte{0x68, 0x65, 0x6c, 0x6c, 0x6f}, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { - got, err := test.processor.Process(t.Context(), test.payload) + got, err := stringEncoder.Process(t.Context(), test.payload) gotBytes, ok := got.([]byte) if !ok {