(t *testing.T)
| 233 | } |
| 234 | |
| 235 | func TestDecodeJSONArrayOfObjects(t *testing.T) { |
| 236 | in := `{"foo": [{"bar": "foo"}, {"foo": "bar"}]}` |
| 237 | expected := sops.TreeBranch{ |
| 238 | sops.TreeItem{ |
| 239 | Key: "foo", |
| 240 | Value: []interface{}{ |
| 241 | sops.TreeBranch{ |
| 242 | sops.TreeItem{ |
| 243 | Key: "bar", |
| 244 | Value: "foo", |
| 245 | }, |
| 246 | }, |
| 247 | sops.TreeBranch{ |
| 248 | sops.TreeItem{ |
| 249 | Key: "foo", |
| 250 | Value: "bar", |
| 251 | }, |
| 252 | }, |
| 253 | }, |
| 254 | }, |
| 255 | } |
| 256 | branch, err := Store{}.treeBranchFromJSON([]byte(in)) |
| 257 | assert.Nil(t, err) |
| 258 | assert.Equal(t, expected, branch) |
| 259 | } |
| 260 | |
| 261 | func TestDecodeJSONArrayOfArrays(t *testing.T) { |
| 262 | in := `{"foo": [[["foo", {"bar": "foo"}]]]}` |
nothing calls this directly
no test coverage detected