MCPcopy Index your code
hub / github.com/getsops/sops / TestUnsetArrayLastItem

Function TestUnsetArrayLastItem

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

Source from the content-addressed store, hash-verified

1409}
1410
1411func TestUnsetArrayLastItem(t *testing.T) {
1412 branch := TreeBranch{
1413 TreeItem{
1414 Key: "foo",
1415 Value: []interface{}{
1416 TreeBranch{
1417 TreeItem{
1418 Key: "bar",
1419 Value: "bar",
1420 },
1421 },
1422 },
1423 },
1424 }
1425 unset, err := branch.Unset([]interface{}{"foo", 0})
1426 assert.NoError(t, err)
1427 assert.Equal(t, TreeBranch{
1428 TreeItem{
1429 Key: "foo",
1430 Value: []interface{}{},
1431 },
1432 }, unset)
1433}
1434
1435func TestUnsetKeyNotFound(t *testing.T) {
1436 branch := TreeBranch{

Callers

nothing calls this directly

Calls 1

UnsetMethod · 0.95

Tested by

no test coverage detected