start pruning reimplementation in cmd/pruning subpackage

This commit is contained in:
Christian Schwarz
2018-08-27 15:09:24 +02:00
parent b4ea5f56b2
commit ecd9db4ac6
6 changed files with 231 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package pruning
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestShallowCopySnapList(t *testing.T) {
l1 := []Snapshot{
stubSnap{name: "foo"},
stubSnap{name: "bar"},
}
l2 := shallowCopySnapList(l1)
assert.Equal(t, l1, l2)
l1[0] = stubSnap{name: "baz"}
assert.Equal(t, "baz", l1[0].Name())
assert.Equal(t, "foo", l2[0].Name())
}