Skip to content

Commit

Permalink
update test expectations for string list
Browse files Browse the repository at this point in the history
  • Loading branch information
crewjam committed Aug 12, 2016
1 parent 10b532f commit d0951f5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion string_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d0951f5

Please sign in to comment.