mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
Merge pull request #821 from travisturner/container-thaw-v21
remove container thaw in test; use repair instead
This commit is contained in:
commit
5e79e224f2
2 changed files with 10 additions and 4 deletions
|
|
@ -4617,8 +4617,8 @@ func compareArrayArray(a1, a2 []uint16) error {
|
|||
// an error describing any difference it finds. This is mostly intended
|
||||
// for use in tests that expect equality.
|
||||
func (c *Container) BitwiseCompare(c2 *Container) error {
|
||||
if c.N() != c2.N() {
|
||||
return errors.New("containers are different lengths")
|
||||
if cn, c2n := c.N(), c2.N(); cn != c2n {
|
||||
return errors.Errorf("containers are different lengths: %d, %d", cn, c2n)
|
||||
}
|
||||
if c.N() == 0 {
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -4391,12 +4391,18 @@ func TestUnionRunRunInPlaceBitwiseCompare(t *testing.T) {
|
|||
for _, a := range runs {
|
||||
for _, b := range runs {
|
||||
t.Run(a.name+"-"+b.name, func(t *testing.T) {
|
||||
arun := doContainer(containerRun, a.run).Thaw()
|
||||
brun := doContainer(containerRun, b.run).Thaw()
|
||||
arun := doContainer(containerRun, a.run)
|
||||
brun := doContainer(containerRun, b.run)
|
||||
|
||||
out1 := unionBitmapRunInPlace(arun.runToBitmap(), brun)
|
||||
out2 := unionRunRunInPlace(arun, brun)
|
||||
|
||||
// Because these containers have been modified using in-place
|
||||
// methods, we need to repair them before comparison to ensure
|
||||
// that their `n` value is updated.
|
||||
out1.Repair()
|
||||
out2.Repair()
|
||||
|
||||
err := out1.BitwiseCompare(out2.runToBitmap())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue