mirror of
https://github.com/jwetzell/psn-go.git
synced 2026-09-10 08:39:37 +00:00
use t.Run for tests
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package decoders
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
@@ -111,18 +110,16 @@ func TestGoodDataTrackerChunkDecoding(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
t.Run(testCase.description, func(t *testing.T) {
|
||||
actual, err := DecodeDataTrackerChunk(testCase.bytes)
|
||||
|
||||
actual, err := DecodeDataTrackerChunk(testCase.bytes)
|
||||
if err != nil {
|
||||
t.Errorf("failed to decode chunk properly, error: %v", err)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Test '%s' failed to decode chunk properly", testCase.description)
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(actual, testCase.expected) {
|
||||
t.Errorf("Test '%s' failed to decode chunk properly", testCase.description)
|
||||
fmt.Printf("expected: %+v\n", testCase.expected)
|
||||
fmt.Printf("actual: %+v\n", actual)
|
||||
}
|
||||
if !reflect.DeepEqual(actual, testCase.expected) {
|
||||
t.Errorf("failed to decode chunk properly, expected: %+v, actual: %+v", testCase.expected, actual)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user