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

Function TestSetArrayNonLeaf

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

Source from the content-addressed store, hash-verified

1170}
1171
1172func TestSetArrayNonLeaf(t *testing.T) {
1173 branch := TreeBranch{
1174 TreeItem{
1175 Key: "array",
1176 Value: []interface{}{
1177 1,
1178 },
1179 },
1180 }
1181 set, changed := branch.Set([]interface{}{"array", 0, "hello"}, "hello")
1182 assert.Equal(t, true, changed)
1183 assert.Equal(t, TreeBranch{
1184 TreeItem{
1185 Key: "array",
1186 Value: []interface{}{
1187 TreeBranch{
1188 TreeItem{
1189 Key: "hello",
1190 Value: "hello",
1191 },
1192 },
1193 },
1194 },
1195 }, set)
1196}
1197
1198func TestUnsetKeyRootLeaf(t *testing.T) {
1199 branch := TreeBranch{

Callers

nothing calls this directly

Calls 1

SetMethod · 0.95

Tested by

no test coverage detected