diff options
Diffstat (limited to 'common/types/convert_test.go')
-rw-r--r-- | common/types/convert_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/types/convert_test.go b/common/types/convert_test.go index 7f86f4c8a..8a4f04db2 100644 --- a/common/types/convert_test.go +++ b/common/types/convert_test.go @@ -14,6 +14,7 @@ package types import ( + "encoding/json" "testing" qt "github.com/frankban/quicktest" @@ -27,3 +28,11 @@ func TestToStringSlicePreserveString(t *testing.T) { c.Assert(ToStringSlicePreserveString(nil), qt.IsNil) } + +func TestToString(t *testing.T) { + c := qt.New(t) + + c.Assert(ToString([]byte("Hugo")), qt.Equals, "Hugo") + c.Assert(ToString(json.RawMessage("Hugo")), qt.Equals, "Hugo") + +} |