Improve tests

This commit is contained in:
Fatih Arslan 2014-07-30 21:24:28 +03:00
parent 4875a9916b
commit e68f708c4c

View File

@ -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)
}
}