Skip to content

Commit

Permalink
[marshal] Add an invalid marshaling test.
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed Mar 21, 2017
1 parent 73cd20e commit f630cb4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions marshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,17 @@ func BenchmarkMapMarshal(b *testing.B) {
e.marshal(reflect.ValueOf(data))
}
}

func TestInvalidMarshal(t *testing.T) {
type I struct {
// you can't marshal funcs!
Thing func()
}
var val I
data, err := Marshal(val, OpenStepFormat)
if err == nil {
t.Fatalf("expected error; got plist data: %x", data)
} else {
t.Log(err)
}
}

0 comments on commit f630cb4

Please sign in to comment.