structure_test: cover panicing of Name()
This commit is contained in:
parent
76f7c2b740
commit
563e458c93
@ -779,4 +779,13 @@ func TestName(t *testing.T) {
|
|||||||
if m != "" {
|
if m != "" {
|
||||||
t.Error("Name should return empty string for unnamed struct, got: %s", n)
|
t.Error("Name should return empty string for unnamed struct, got: %s", n)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
err := recover()
|
||||||
|
if err == nil {
|
||||||
|
t.Error("Name should panic if a non struct is passed")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
Name([]string{})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user