diff --git a/structure_test.go b/structure_test.go index 3972581..ff18f3b 100644 --- a/structure_test.go +++ b/structure_test.go @@ -120,10 +120,10 @@ func TestMap_Anonymous(t *testing.T) { type A struct { Name string } - a := A{Name: "example"} + a := &A{Name: "example"} type B struct { - A + *A } b := &B{} b.A = a @@ -424,4 +424,10 @@ func TestName(t *testing.T) { if n != "Foo" { t.Error("Name should return Foo, got: %s", n) } + + unnamed := struct{ Name string }{Name: "Cihangir"} + m := Name(unnamed) + if m != "" { + t.Error("Name should return empty string for unnamed struct, got: %s", n) + } }