(t *testing.T)
| 1097 | } |
| 1098 | |
| 1099 | func TestSetNewKeyDeep(t *testing.T) { |
| 1100 | branch := TreeBranch{ |
| 1101 | TreeItem{ |
| 1102 | Key: "foo", |
| 1103 | Value: "bar", |
| 1104 | }, |
| 1105 | } |
| 1106 | set, changed := branch.Set([]interface{}{"foo", "bar", "baz"}, "hello") |
| 1107 | assert.Equal(t, true, changed) |
| 1108 | assert.Equal(t, "hello", set[0].Value.(TreeBranch)[0].Value.(TreeBranch)[0].Value) |
| 1109 | } |
| 1110 | |
| 1111 | func TestSetNewKeyOnEmptyBranch(t *testing.T) { |
| 1112 | branch := TreeBranch{} |