Improve tests
This commit is contained in:
parent
4875a9916b
commit
e68f708c4c
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user