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

Function TestUnsetArrayItemOutOfBounds

sops_test.go:1472–1489  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1470}
1471
1472func TestUnsetArrayItemOutOfBounds(t *testing.T) {
1473 branch := TreeBranch{
1474 TreeItem{
1475 Key: "foo",
1476 Value: []interface{}{
1477 TreeBranch{
1478 TreeItem{
1479 Key: "bar",
1480 Value: "bar",
1481 },
1482 },
1483 },
1484 },
1485 }
1486 unset, err := branch.Unset([]interface{}{"foo", 99})
1487 assert.Equal(t, err.(*SopsKeyNotFound).Key, 99)
1488 assert.Nil(t, unset, "Unset result was not nil upon %s", err)
1489}
1490
1491func TestUnsetKeyNotABranch(t *testing.T) {
1492 branch := TreeBranch{

Callers

nothing calls this directly

Calls 1

UnsetMethod · 0.95

Tested by

no test coverage detected