Make compoundList.Remove convert return value to List not compoundList.

This commit is contained in:
Benjamin Kalman
2015-12-28 12:52:41 +11:00
parent ff11996ce3
commit c9b20fbb21
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ func (cl compoundList) Remove(start uint64, end uint64) List {
for i := start; i < end; i++ {
seq.Skip()
}
return seq.Done().(compoundList)
return seq.Done().(List)
}
func (cl compoundList) RemoveAt(idx uint64) List {
+10
View File
@@ -440,6 +440,16 @@ func TestCompoundListRemoveNothing(t *testing.T) {
assert.True(cl.Equals(cl.Remove(cl.Len(), cl.Len())))
}
func TestCompoundListRemoveEverything(t *testing.T) {
assert := assert.New(t)
cs := chunks.NewMemoryStore()
cl := getTestSimpleList().ToNomsList(cs).Remove(0, getTestSimpleListLen())
assert.True(NewList(cs).Equals(cl))
assert.Equal(0, int(cl.Len()))
}
func TestCompoundListRemoveAtMiddle(t *testing.T) {
assert := assert.New(t)