diff --git a/types_test.go b/types_test.go index 47aac65..2edbbfc 100644 --- a/types_test.go +++ b/types_test.go @@ -316,6 +316,13 @@ func TestUnmarshalString(t *testing.T) { unmarshalHelper(t, "Some Name\n ", &s, &overwritten) } +func TestStringString(t *testing.T) { + var s String = "foobar" + if s.String() != "foobar" { + t.Fatalf("Unexpected result when returning String.String(): %s\n", s.String()) + } +} + func TestMarshalBoolean(t *testing.T) { var b Boolean = true marshalHelper(t, "Y", &b) @@ -333,6 +340,17 @@ func TestUnmarshalBoolean(t *testing.T) { unmarshalHelper(t, "N\n \t", &b, &overwritten) } +func TestStringBoolean(t *testing.T) { + var b Boolean = true + if b.String() != "true" { + t.Fatalf("Unexpected string for Boolean.String() for true: %s\n", b.String()) + } + b = false + if b.String() != "false" { + t.Fatalf("Unexpected string for Boolean.String() for false: %s\n", b.String()) + } +} + func TestMarshalUID(t *testing.T) { var u UID = "d1cf3d3d-9ef9-4a97-b180-81706829cb04" marshalHelper(t, "d1cf3d3d-9ef9-4a97-b180-81706829cb04", &u)