diff --git a/string_list_test.go b/string_list_test.go index 3f66d51..c5d80fa 100644 --- a/string_list_test.go +++ b/string_list_test.go @@ -49,9 +49,14 @@ func (testSuite *StringListTest) TestStringList(c *C) { err = json.Unmarshal([]byte(inputBuf), &v) c.Assert(err, ErrorMatches, "json: cannot unmarshal .*") + // A single string where a string list is expected returns + // a string list. inputBuf = `{"A": "asdf"}` err = json.Unmarshal([]byte(inputBuf), &v) - c.Assert(err, ErrorMatches, "json: cannot unmarshal .*") + c.Assert(err, IsNil) + buf, err = json.Marshal(v) + c.Assert(err, IsNil) + c.Assert(string(buf), Equals, `{"A":["asdf"]}`) inputBuf = `{"A": [false]}` err = json.Unmarshal([]byte(inputBuf), &v)