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

Function TestUnsetArrayItem

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

Source from the content-addressed store, hash-verified

1337}
1338
1339func TestUnsetArrayItem(t *testing.T) {
1340 branch := TreeBranch{
1341 TreeItem{
1342 Key: "foo",
1343 Value: []interface{}{
1344 TreeBranch{
1345 TreeItem{
1346 Key: "bar",
1347 Value: "bar",
1348 },
1349 },
1350 TreeBranch{
1351 TreeItem{
1352 Key: "barbar",
1353 Value: "barbar",
1354 },
1355 },
1356 },
1357 },
1358 }
1359 unset, err := branch.Unset([]interface{}{"foo", 1})
1360 assert.NoError(t, err)
1361 assert.Equal(t, TreeBranch{
1362 TreeItem{
1363 Key: "foo",
1364 Value: []interface{}{
1365 TreeBranch{
1366 TreeItem{
1367 Key: "bar",
1368 Value: "bar",
1369 },
1370 },
1371 },
1372 },
1373 }, unset)
1374}
1375
1376func TestUnsetKeyInArrayItem(t *testing.T) {
1377 branch := TreeBranch{

Callers

nothing calls this directly

Calls 1

UnsetMethod · 0.95

Tested by

no test coverage detected