Skip to content

Commit

Permalink
add error test
Browse files Browse the repository at this point in the history
  • Loading branch information
ota42y committed Dec 20, 2015
1 parent 5cc0c8c commit d3ed2ca
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ import (

}

func TestGenerateError(t *testing.T) {
invalidData := "invalid"
input := strings.NewReader(invalidData)

b, err := Generate(input, "", "")
if err == nil {
t.Error("if invalid toml data, should return error, but nil")
}

if b != nil {
t.Errorf("if invalid toml data, should return nil, but %v", b)
}
}

func TestGenerate(t *testing.T) {
structName := "Normal"
pkgName := "example"
Expand Down

0 comments on commit d3ed2ca

Please sign in to comment.