(t *testing.T)
| 211 | } |
| 212 | |
| 213 | func TestDecodeJSONWithArray(t *testing.T) { |
| 214 | in := `{"foo": {"foo": [1, 2, 3]}, "bar": "baz"}` |
| 215 | expected := sops.TreeBranch{ |
| 216 | sops.TreeItem{ |
| 217 | Key: "foo", |
| 218 | Value: sops.TreeBranch{ |
| 219 | sops.TreeItem{ |
| 220 | Key: "foo", |
| 221 | Value: []interface{}{1, 2, 3}, |
| 222 | }, |
| 223 | }, |
| 224 | }, |
| 225 | sops.TreeItem{ |
| 226 | Key: "bar", |
| 227 | Value: "baz", |
| 228 | }, |
| 229 | } |
| 230 | branch, err := Store{}.treeBranchFromJSON([]byte(in)) |
| 231 | assert.Nil(t, err) |
| 232 | assert.Equal(t, expected, branch) |
| 233 | } |
| 234 | |
| 235 | func TestDecodeJSONArrayOfObjects(t *testing.T) { |
| 236 | in := `{"foo": [{"bar": "foo"}, {"foo": "bar"}]}` |
nothing calls this directly
no test coverage detected