(t *testing.T)
| 1151 | } |
| 1152 | |
| 1153 | func TestSetArrayLeafNewItem(t *testing.T) { |
| 1154 | branch := TreeBranch{ |
| 1155 | TreeItem{ |
| 1156 | Key: "array", |
| 1157 | Value: []interface{}{}, |
| 1158 | }, |
| 1159 | } |
| 1160 | set, changed := branch.Set([]interface{}{"array", 2}, "hello") |
| 1161 | assert.Equal(t, true, changed) |
| 1162 | assert.Equal(t, TreeBranch{ |
| 1163 | TreeItem{ |
| 1164 | Key: "array", |
| 1165 | Value: []interface{}{ |
| 1166 | "hello", |
| 1167 | }, |
| 1168 | }, |
| 1169 | }, set) |
| 1170 | } |
| 1171 | |
| 1172 | func TestSetArrayNonLeaf(t *testing.T) { |
| 1173 | branch := TreeBranch{ |