Move String functions to test file

This commit is contained in:
Alan Bernstein 2017-06-14 17:07:08 -05:00 committed by Matt Jaffee
parent 76a05d38b5
commit 18aacbb65a
2 changed files with 10 additions and 5 deletions

View file

@ -1046,11 +1046,6 @@ func (iv interval32) runlen() int {
return 1 + int(iv.last) - int(iv.start)
}
// String produces a human viewable string of the contents.
func (iv interval32) String() string {
return fmt.Sprintf("[%d, %d]", iv.start, iv.last)
}
// newContainer returns a new instance of container.
func newContainer() *container {
return &container{}

View file

@ -15,11 +15,21 @@
package roaring
import (
"fmt"
"bytes"
"reflect"
"testing"
)
// String produces a human viewable string of the contents.
func (iv interval32) String() string {
return fmt.Sprintf("[%d, %d]", iv.start, iv.last)
}
func (c *container) String() string {
return fmt.Sprintf("<%s container (%v), n=%d, array[%d], runs[%d], bitmap[%d]>", c.info().Type, &c, c.n, len(c.array), len(c.runs), len(c.bitmap))
}
func TestRunAppendInterval(t *testing.T) {
a := container{}
tests := []struct {