MCPcopy
hub / github.com/getsops/sops / TestDecodeJSONArrayOfArrays

Function TestDecodeJSONArrayOfArrays

stores/json/store_test.go:261–284  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

259}
260
261func 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
286func TestEncodeSimpleJSON(t *testing.T) {
287 branch := sops.TreeBranch{

Callers

nothing calls this directly

Calls 1

treeBranchFromJSONMethod · 0.80

Tested by

no test coverage detected