(t *testing.T)
| 259 | } |
| 260 | |
| 261 | func TestDecodeJSONArrayOfArrays(t *testing.T) { |
| 262 | in := `{"foo": [[["foo", {"bar": "foo"}]]]}` |
| 263 | expected := sops.TreeBranch{ |
| 264 | sops.TreeItem{ |
| 265 | Key: "foo", |
| 266 | Value: []interface{}{ |
| 267 | []interface{}{ |
| 268 | []interface{}{ |
| 269 | "foo", |
| 270 | sops.TreeBranch{ |
| 271 | sops.TreeItem{ |
| 272 | Key: "bar", |
| 273 | Value: "foo", |
| 274 | }, |
| 275 | }, |
| 276 | }, |
| 277 | }, |
| 278 | }, |
| 279 | }, |
| 280 | } |
| 281 | branch, err := Store{}.treeBranchFromJSON([]byte(in)) |
| 282 | assert.Nil(t, err) |
| 283 | assert.Equal(t, expected, branch) |
| 284 | } |
| 285 | |
| 286 | func TestEncodeSimpleJSON(t *testing.T) { |
| 287 | branch := sops.TreeBranch{ |
nothing calls this directly
no test coverage detected