From 7c374519c4d068d66af46a3dfca33d7f35e72269 Mon Sep 17 00:00:00 2001 From: Zilong Wang Date: Thu, 28 Mar 2019 16:27:11 -0400 Subject: [PATCH] fix tests --- go.mod | 5 ++++- go.sum | 7 +++++++ parse/parse_test.go | 11 ++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index feded3f..0546c96 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,7 @@ module github.com/cheekybits/genny go 1.12 -require golang.org/x/tools v0.0.0-20190328030505-8f05a32dce9f +require ( + github.com/stretchr/testify v1.3.0 + golang.org/x/tools v0.0.0-20190328030505-8f05a32dce9f +) diff --git a/go.sum b/go.sum index 7e939f3..5efe413 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,10 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/parse/parse_test.go b/parse/parse_test.go index 28c0fc1..3414887 100644 --- a/parse/parse_test.go +++ b/parse/parse_test.go @@ -12,10 +12,11 @@ import ( var tests = []struct { // input - filename string - pkgName string - in string - types []map[string]string + filename string + outputFilename string + pkgName string + in string + types []map[string]string // expectations expectedOut string @@ -118,7 +119,7 @@ func TestParse(t *testing.T) { test.in = contents(test.in) test.expectedOut = contents(test.expectedOut) - bytes, err := parse.Generics(test.filename, test.pkgName, strings.NewReader(test.in), test.types) + bytes, err := parse.Generics(test.filename, test.outputFilename, test.pkgName, strings.NewReader(test.in), test.types) // check the error if test.expectedErr == nil {