Skip to content

Commit

Permalink
remove gocheck and use testify/assert
Browse files Browse the repository at this point in the history
  • Loading branch information
elmacnifico committed Sep 14, 2016
1 parent e528c2f commit 46abb66
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 272 deletions.
15 changes: 6 additions & 9 deletions decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"reflect"
"strings"
"testing"

"github.com/stretchr/testify/assert"
)

func TestBool(t *testing.T) {
Expand Down Expand Up @@ -203,9 +205,8 @@ func validateDecoding(t *testing.T, tests map[string]interface{}) {

var result interface{}
_, err := d.decode(0, reflect.ValueOf(&result))
if err != nil {
t.Error(err)
}
assert.Nil(t, err)

if !reflect.DeepEqual(result, expected) {
// A big case statement would produce nicer errors
t.Errorf("Output was incorrect: %s %s", inputStr, expected)
Expand All @@ -215,9 +216,7 @@ func validateDecoding(t *testing.T, tests map[string]interface{}) {

func TestPointers(t *testing.T) {
bytes, err := ioutil.ReadFile("test-data/test-data/maps-with-pointers.raw")
if err != nil {
t.Error(err)
}
assert.Nil(t, err)
d := decoder{bytes}

expected := map[uint]map[string]string{
Expand All @@ -232,9 +231,7 @@ func TestPointers(t *testing.T) {
for offset, expectedValue := range expected {
var actual map[string]string
_, err := d.decode(offset, reflect.ValueOf(&actual))
if err != nil {
t.Error(err)
}
assert.Nil(t, err)
if !reflect.DeepEqual(actual, expectedValue) {
t.Errorf("Decode for pointer at %d failed", offset)
}
Expand Down
Loading

0 comments on commit 46abb66

Please sign in to comment.