From 1c49548a4cee66765d2ad9788a167726b320fb70 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sun, 8 Feb 2026 21:38:44 -0600 Subject: [PATCH] test cleanup --- internal/processor/string-decode_test.go | 17 +++++++---------- internal/processor/string-encode_test.go | 4 +--- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/internal/processor/string-decode_test.go b/internal/processor/string-decode_test.go index 0223215..dff2f9f 100644 --- a/internal/processor/string-decode_test.go +++ b/internal/processor/string-decode_test.go @@ -40,22 +40,20 @@ func TestStringDecodeFromRegistry(t *testing.T) { func TestGoodStringDecode(t *testing.T) { stringDecoder := processor.StringDecode{} tests := []struct { - processor processor.Processor - name string - payload any - expected string + name string + payload any + expected string }{ { - processor: &stringDecoder, - name: "hello", - payload: []byte{0x68, 0x65, 0x6c, 0x6c, 0x6f}, - expected: "hello", + name: "hello", + payload: []byte{0x68, 0x65, 0x6c, 0x6c, 0x6f}, + expected: "hello", }, } 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) gotString, ok := got.(string) if !ok { @@ -74,7 +72,6 @@ func TestGoodStringDecode(t *testing.T) { func TestBadStringDecode(t *testing.T) { stringDecoder := processor.StringDecode{} tests := []struct { - processor processor.Processor name string payload any errorString string diff --git a/internal/processor/string-encode_test.go b/internal/processor/string-encode_test.go index 5d40c0f..a1db3b4 100644 --- a/internal/processor/string-encode_test.go +++ b/internal/processor/string-encode_test.go @@ -79,13 +79,11 @@ func TestGoodStringEncode(t *testing.T) { func TestBadStringEncode(t *testing.T) { stringEncoder := processor.StringEncode{} tests := []struct { - processor processor.Processor name string payload any errorString string }{ { - processor: &stringEncoder, name: "non-string input", payload: []byte{0x68, 0x65, 0x6c, 0x6c, 0x6f}, errorString: "string.encode processor only accepts a string", @@ -94,7 +92,7 @@ func TestBadStringEncode(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 := stringEncoder.Process(t.Context(), test.payload) if err == nil { t.Fatalf("string.encode expected to fail but got payload: %s", got)