mirror of
https://github.com/zrepl/zrepl.git
synced 2025-08-17 18:31:02 +02:00
move implementation to internal/
directory (#828)
This commit is contained in:
committed by
GitHub
parent
b9b9ad10cf
commit
908807bd59
39
internal/pruning/keep_not_replicated_test.go
Normal file
39
internal/pruning/keep_not_replicated_test.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package pruning
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewKeepNotReplicated(t *testing.T) {
|
||||
|
||||
inputs := map[string][]Snapshot{
|
||||
"s1": []Snapshot{
|
||||
stubSnap{name: "1", replicated: true},
|
||||
stubSnap{name: "2", replicated: false},
|
||||
stubSnap{name: "3", replicated: true},
|
||||
},
|
||||
"s2": []Snapshot{},
|
||||
}
|
||||
|
||||
tcs := map[string]testCase{
|
||||
"destroysOnlyReplicated": {
|
||||
inputs: inputs["s1"],
|
||||
rules: []KeepRule{
|
||||
NewKeepNotReplicated(),
|
||||
},
|
||||
expDestroy: map[string]bool{
|
||||
"1": true, "3": true,
|
||||
},
|
||||
},
|
||||
"empty": {
|
||||
inputs: inputs["s2"],
|
||||
rules: []KeepRule{
|
||||
NewKeepNotReplicated(),
|
||||
},
|
||||
expDestroy: map[string]bool{},
|
||||
},
|
||||
}
|
||||
|
||||
testTable(tcs, t)
|
||||
|
||||
}
|
Reference in New Issue
Block a user