Skip to content

Commit

Permalink
Fix tests (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyreiss authored Jan 23, 2019
1 parent a9fe647 commit 2427e0c
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ package firemodel
import (
"testing"

"gotest.tools/assert"

"os"
"path"

"github.com/davecgh/go-spew/spew"
"github.com/go-test/deep"
)

func TestParseSchema(t *testing.T) {
Expand Down Expand Up @@ -91,15 +90,15 @@ func TestParseSchema(t *testing.T) {
},
{
Name: "friend",
Type: &Reference{T: &SchemaModel{Name: "Friend"}},
Type: &Reference{},
},
{
Name: "location",
Type: &GeoPoint{},
},
{
Name: "colors",
Type: &Array{T: &String{}},
Type: &Array{},
},
{
Name: "meta",
Expand Down Expand Up @@ -145,11 +144,11 @@ func TestParseSchema(t *testing.T) {
},
{
Name: "struct_ary",
Type: &Array{T: &Reference{T: &SchemaModel{Name: "TestModel"}}},
Type: &Array{T: &Struct{T: &SchemaStruct{Name: "TestStruct"}}},
},
{
Name: "enum_ary",
Type: &Array{T: &Enum{T: &SchemaEnum{Name: "TestModel"}}},
Type: &Array{T: &Enum{T: &SchemaEnum{Name: "TestEnum"}}},
},
{
Name: "reference_ary",
Expand All @@ -169,11 +168,11 @@ func TestParseSchema(t *testing.T) {
},
{
Name: "struct_map",
Type: &Map{T: &Struct{T: &SchemaStruct{Name: "TestModel"}}},
Type: &Map{T: &Struct{T: &SchemaStruct{Name: "TestStruct"}}},
},
{
Name: "enum_map",
Type: &Map{T: &Enum{T: &SchemaEnum{Name: "TestModel"}}},
Type: &Map{T: &Enum{T: &SchemaEnum{Name: "TestEnum"}}},
},
{
Name: "generic_map",
Expand Down Expand Up @@ -240,7 +239,9 @@ func TestParseSchema(t *testing.T) {
{
Comment: "The direction.",
Name: "dir",
Type: &Enum{ /*Direction*/ },
Type: &Enum{
T: &SchemaEnum{Name: "Direction"},
},
},
},
Options: SchemaModelOptions{},
Expand Down Expand Up @@ -449,12 +450,7 @@ func TestParseSchema(t *testing.T) {
return
}

if diff := deep.Equal(got, tt.want); diff != nil {
t.Logf("ParseSchema() => %#v", spew.NewFormatter(got))
for _, diff := range diff {
t.Error(diff)
}
}
assert.DeepEqual(t, got, tt.want)
})
}
}

0 comments on commit 2427e0c

Please sign in to comment.