mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-05 16:15:56 +00:00
expand coverage of IntersectRunRun
This commit is contained in:
parent
1b7eef4fc8
commit
f334d122c8
1 changed files with 21 additions and 3 deletions
|
|
@ -468,17 +468,35 @@ func TestIntersectRunRun(t *testing.T) {
|
|||
exp: []interval32{{start: 5, last: 5}, {start: 7, last: 10}},
|
||||
expN: 5,
|
||||
},
|
||||
{
|
||||
aruns: []interval32{{start: 20, last: 30}},
|
||||
bruns: []interval32{{start: 5, last: 10}, {start: 19, last: 21}},
|
||||
exp: []interval32{{start: 20, last: 21}},
|
||||
expN: 2,
|
||||
},
|
||||
{
|
||||
aruns: []interval32{{start: 5, last: 10}},
|
||||
bruns: []interval32{{start: 7, last: 12}},
|
||||
exp: []interval32{{start: 7, last: 10}},
|
||||
expN: 4,
|
||||
},
|
||||
{
|
||||
aruns: []interval32{{start: 5, last: 12}},
|
||||
bruns: []interval32{{start: 7, last: 10}},
|
||||
exp: []interval32{{start: 7, last: 10}},
|
||||
expN: 4,
|
||||
},
|
||||
}
|
||||
for i, test := range tests {
|
||||
a.runs = test.aruns
|
||||
b.runs = test.bruns
|
||||
ret := intersectRunRun(a, b)
|
||||
if !reflect.DeepEqual(ret.runs, test.exp) {
|
||||
t.Fatalf("test #%v expected %v, but got %v", i, test.exp, ret.runs)
|
||||
}
|
||||
if ret.n != test.expN {
|
||||
t.Fatalf("test #%v expected n to be %v, but got %v", i, test.expN, ret.n)
|
||||
}
|
||||
if !reflect.DeepEqual(ret.runs, test.exp) {
|
||||
t.Fatalf("test #%v expected %v, but got %v", i, test.exp, ret.runs)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue