mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
align test err checking and logs
This commit is contained in:
@@ -75,14 +75,15 @@ func TestGoodJsonDecode(t *testing.T) {
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
got, err := jsonDecoder.Process(t.Context(), test.payload)
|
||||
if err != nil {
|
||||
t.Fatalf("json.decode processing failed: %s", err)
|
||||
}
|
||||
|
||||
gotMap, ok := got.(map[string]any)
|
||||
if !ok {
|
||||
t.Fatalf("json.decode returned a %T payload: %s", got, got)
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatalf("json.decode failed: %s", err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(gotMap, test.expected) {
|
||||
t.Fatalf("json.decode got %x, expected %s", got, test.expected)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user