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

Function TestSetNewKey

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

Source from the content-addressed store, hash-verified

1007}
1008
1009func TestSetNewKey(t *testing.T) {
1010 branch := TreeBranch{
1011 TreeItem{
1012 Key: "foo",
1013 Value: TreeBranch{
1014 TreeItem{
1015 Key: "bar",
1016 Value: TreeBranch{
1017 TreeItem{
1018 Key: "baz",
1019 Value: "foobar",
1020 },
1021 },
1022 },
1023 },
1024 },
1025 }
1026 set, changed := branch.Set([]interface{}{"foo", "bar", "foo"}, "hello")
1027 assert.Equal(t, true, changed)
1028 assert.Equal(t, "hello", set[0].Value.(TreeBranch)[0].Value.(TreeBranch)[1].Value)
1029}
1030
1031func TestSetNewKeyUnchanged(t *testing.T) {
1032 branch := TreeBranch{

Callers

nothing calls this directly

Calls 1

SetMethod · 0.95

Tested by

no test coverage detected