From e68f708c4c48a019088d86ebc4687a94da10a163 Mon Sep 17 00:00:00 2001 From: Fatih Arslan Date: Wed, 30 Jul 2014 21:24:28 +0300 Subject: [PATCH] Improve tests --- structure_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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) + } }