mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-28 19:34:58 +01:00
23 lines
364 B
Go
23 lines
364 B
Go
|
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())
|
||
|
|
||
|
}
|