Commit 82e47bc1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 38715d34
......@@ -82,10 +82,8 @@ func TestPPTreeSubSetOps(t *testing.T) {
}
for _, tt := range testv {
U := tt.A.Clone()
U.UnionInplace(tt.B)
D := tt.A.Clone()
D.DifferenceInplace(tt.B)
U := tt.A.Union(tt.B)
D := tt.A.Difference(tt.B)
if !U.Equal(tt.Union) {
t.Errorf("Union:\n A: %s\n B: %s\n ->u: %s\n okU: %s\n", tt.A, tt.B, U, tt.Union)
......
......@@ -128,6 +128,7 @@ func (S *RangeSet) verify() {
}
}
// XXX Equal
// Clone returns copy of the set.
func (orig *RangeSet) Clone() *RangeSet {
......
......@@ -51,7 +51,7 @@ func TestRangeSet(t *testing.T) {
return S
}
testv := testEntry{
testv := []testEntry{
E(
S(), // A
S(), // B
......@@ -66,4 +66,16 @@ func TestRangeSet(t *testing.T) {
// XXX
}
for _, tt := range testv {
U := tt.A.Union(tt.B)
D := tt.A.Difference(tt.B)
if !U.Equal(tt.Union) {
t.Errorf("Union:\n A: %s\n B: %s\n ->u: %s\n okU: %s\n", tt.A, tt.B, U, tt.Union)
}
if !D.Equal(tt.Difference) {
t.Errorf("Difference:\n A: %s\n B: %s\n ->d: %s\n okD: %s\n", tt.A, tt.B, D, tt.Difference)
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment