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

Function TestUnsetKeyBranchLastLeaf

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

Source from the content-addressed store, hash-verified

1286}
1287
1288func TestUnsetKeyBranchLastLeaf(t *testing.T) {
1289 branch := TreeBranch{
1290 TreeItem{
1291 Key: "foo",
1292 Value: TreeBranch{
1293 TreeItem{
1294 Key: "bar",
1295 Value: "bar",
1296 },
1297 },
1298 },
1299 }
1300 unset, err := branch.Unset([]interface{}{"foo", "bar"})
1301 assert.NoError(t, err)
1302 assert.Equal(t, TreeBranch{
1303 TreeItem{
1304 Key: "foo",
1305 Value: TreeBranch{},
1306 },
1307 }, unset)
1308}
1309
1310func TestUnsetKeyArray(t *testing.T) {
1311 branch := TreeBranch{

Callers

nothing calls this directly

Calls 1

UnsetMethod · 0.95

Tested by

no test coverage detected