mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
test cleanup
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user