diff --git a/.gitignore b/.gitignore index b25c15b..ad14094 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *~ +/cover.out diff --git a/Readme.md b/Readme.md index 6d6d12f..9952389 100644 --- a/Readme.md +++ b/Readme.md @@ -1,8 +1,8 @@ # Hashsplit - content-based splitting of byte streams -[![Go Reference](https://pkg.go.dev/badge/github.com/bobg/hashsplit/v2.svg)](https://pkg.go.dev/github.com/bobg/hashsplit/v2) -[![Go Report Card](https://goreportcard.com/badge/github.com/bobg/hashsplit/v2)](https://goreportcard.com/report/github.com/bobg/hashsplit/v2) -![Tests](https://github.com/bobg/hashsplit/actions/workflows/go.yml/badge.svg) +[![Go Reference](https://pkg.go.dev/badge/github.com/bobg/hashsplit/v3.svg)](https://pkg.go.dev/github.com/bobg/hashsplit/v3) +[![Go Report Card](https://goreportcard.com/badge/github.com/bobg/hashsplit/v3)](https://goreportcard.com/report/github.com/bobg/hashsplit/v3) +[![Tests](https://github.com/bobg/hashsplit/actions/workflows/go.yml/badge.svg)](https://github.com/bobg/hashsplit/actions/workflows/go.yml) [![Coverage Status](https://coveralls.io/repos/github/bobg/hashsplit/badge.svg?branch=master)](https://coveralls.io/github/bobg/hashsplit?branch=master) Hashsplitting is a way of dividing a byte stream into pieces diff --git a/cp32/cp32.go b/cp32/cp32.go new file mode 100644 index 0000000..0772e3a --- /dev/null +++ b/cp32/cp32.go @@ -0,0 +1,123 @@ +package cp32 + +import "hash" + +// See https://hashsplit.github.io/spec.html#appendix +var g = [...]uint32{ + 0x6b326ac4, 0x13f8e1bd, 0x1d61066f, 0x87733fc7, 0x37145391, 0x1c115e40, + 0xd2ea17a3, 0x8650e4b1, 0xe892bb09, 0x408a0c3a, 0x3c40b72c, 0x2a988fb0, + 0xf691d0f8, 0xb22072d9, 0x6fa8b705, 0x72bd6386, 0xdd905ac3, 0x7fcba0ba, + 0x4f84a51c, 0x1dd8477e, 0x6f972f2c, 0xaccd018e, 0xe2964f13, 0x7a7d2388, + 0xebf42ca7, 0xa8e2a0a2, 0x8eb726d3, 0xccd169b6, 0x5444f61e, 0xe178ad7a, + 0xd556a18d, 0xbac80ef4, 0x34cb8a87, 0x7740a1a9, 0x62640fe1, 0xb1e64472, + 0xdee2d6c8, 0x27849114, 0xb6333f4b, 0xbb0b5c1d, 0x57e53652, 0xfde51999, + 0xef773313, 0x1bbaf941, 0x2e9aa084, 0x37587ab8, 0xa61e7c54, 0xb779be61, + 0xd8795bfd, 0x1707c1f6, 0x50fe9c54, 0x32ff3685, 0x94f55c22, 0x2a32ce1a, + 0x0b9076ab, 0x14363079, 0xae994b2c, 0x4a8da881, 0x4770b9c4, 0xf4d143dd, + 0x70a90c0b, 0xa094582a, 0x4b254d10, 0x2454325e, 0x1725a589, 0x9a3380da, + 0x948eeade, 0x79f88224, 0x7b8dc378, 0xc2090db6, 0x41f7a7ac, 0xd4d9528c, + 0x7f0bace7, 0xd3157814, 0xd7757bc4, 0xb428db06, 0x2e2b1d02, 0x0499bcf5, + 0x310f963e, 0xe5f31a83, 0xe0cd600f, 0x8b48af14, 0x568eb23a, 0x01d1150b, + 0x33f54023, 0xa0e59fdf, 0x8d17c2dd, 0xfb7bd347, 0x4d8cd432, 0x664db8de, + 0xd48f2a6c, 0x16c3412d, 0x873a32fc, 0x10796a21, 0xed40f0f8, 0x5ca8e9b2, + 0x0f70d259, 0x0df532c2, 0x016d73aa, 0x45761aa5, 0x189b45a7, 0x4accd733, + 0x641f90e3, 0x592ed9ee, 0x4b1d72ad, 0x42ff2cd4, 0x0654b609, 0x799012c0, + 0x595f36a4, 0x082bdbd6, 0x0375ddd3, 0xc16c1fb5, 0x57492df8, 0xa2d56a98, + 0xdfb2aa28, 0x3728f35f, 0xdc49ea71, 0x9aee8377, 0xd62de2ab, 0x2c3aa155, + 0x407d9eed, 0xbc5b3832, 0x42961924, 0x1498172a, 0xc7126716, 0x95494b56, + 0xd40442fb, 0xb22a3ed1, 0x0ad3e0ae, 0x77a6136a, 0xfb1bc3f0, 0x1a715c38, + 0xccbbd21d, 0x061ff037, 0x85d700cb, 0x8a8fb396, 0x956bbe48, 0xf2556ed8, + 0x3319c88b, 0xe0d6d3e9, 0x4783b316, 0x03a73543, 0x253be5ed, 0x41322aea, + 0xdfc00c7a, 0x972b9413, 0xccca42f5, 0x0a1cdf35, 0xa2dc31b8, 0xf48397eb, + 0xbe3f2b3e, 0xd2950b9f, 0xccd269cf, 0x51a64ca9, 0xea46d96e, 0xcaec892e, + 0x3fae3a62, 0xf12e53db, 0x3753464c, 0x214fbd91, 0x609ce2f7, 0x6158b44c, + 0xa74b8027, 0x79f36912, 0x16cac162, 0x5e76df4f, 0xbc4184fb, 0x912cac7d, + 0xf97e5704, 0x664dd25f, 0x7d837805, 0x5386cfe0, 0x4e585d77, 0xa0fa527e, + 0xeb5c8401, 0xa186cc51, 0x05ef3f1f, 0xc1efc774, 0x38730c2c, 0xad9c5539, + 0x27cd4938, 0x7317b4f2, 0x852c186f, 0xa4c9b0f4, 0xf592f010, 0xf6fe86f3, + 0xb14ba86c, 0x07109a27, 0x0d00568d, 0xd92ee49f, 0xdc643eb3, 0x8d81c333, + 0xcd1d7bbd, 0x87ff9cda, 0x80fa4285, 0x25258d5b, 0xd9e4065a, 0x78955c18, + 0x84874c2a, 0xfdae136b, 0x48eeb3d3, 0xc2623958, 0x5a74f96d, 0x0bcb49f5, + 0x3041cefc, 0xa5b0a1a8, 0x2d29bae6, 0x916ace93, 0x0e70564d, 0xa24894ae, + 0x9897044d, 0xcba97c2a, 0x52a313b1, 0x318ec481, 0xc4729ec1, 0xd90ad78a, + 0x55eb9f90, 0x4f159fda, 0xa90fbd44, 0xd0ca6208, 0x5c597269, 0xe05a471e, + 0x26a5e224, 0x97144944, 0xece2c486, 0xf65c9a9e, 0x82a3fbbb, 0x925d1a62, + 0xd6c4c29b, 0x61b9292d, 0x161529c9, 0x37713240, 0x68ec933b, 0xed80a4e5, + 0x02b2db41, 0x47cfd676, 0xbfe26b41, 0x5e8468bb, 0x6e0d15a4, 0x40383ef4, + 0x81e622fb, 0x194b378c, 0x0c503af5, 0x8e0033a7, 0x003aaa5e, 0x9d7b6723, + 0x0702e877, 0x34b75166, 0xd1ba98d8, 0x9b9f1794, 0xe8961c84, 0x9d773b17, + 0xf9783ee9, 0xdff11758, 0x49bea2cf, 0xa0e0887f, +} + +// Hash is a [hash.Hash] implementing the cp32 rolling hash algorithm described in the spec at https://github.com/hashsplit/hashsplit-spec. +type Hash struct { + val uint32 // current hash value + window []byte // a circular buffer of the last bytes written + next int // pos in window where the next byte will go +} + +var _ hash.Hash32 = &Hash{} + +const defaultWindowSize = 64 + +// New produces a new [Hash] with the given window size, +// which should be a multiple of 32, +// and is rounded up to the next multiple of 32 if it isn't. +func New(windowSize int) *Hash { + if windowSize <= 0 { + windowSize = defaultWindowSize + } + if r := windowSize % 32; r != 0 { + // round windowSize up to the next multiple of 32 + windowSize += 32 - r + } + + h := &Hash{window: make([]byte, 0, windowSize)} + return h +} + +func (h *Hash) Write(inp []byte) (int, error) { + for _, b := range inp { + h.Roll(b) + } + return len(inp), nil +} + +func (h *Hash) WriteByte(b byte) error { + h.Roll(b) + return nil +} + +func (h *Hash) Sum(b []byte) []byte { + return append(b, byte(h.val>>24), byte(h.val>>16), byte(h.val>>8), byte(h.val)) +} + +// Reset zeroes out the "window" of recently written bytes +// and sets the hash value to the cp32 back to zero. +func (h *Hash) Reset() { + h.window = h.window[:0] + h.val = 0 + h.next = 0 +} + +func (*Hash) Size() int { return 4 } +func (*Hash) BlockSize() int { return 32 } +func (h *Hash) Sum32() uint32 { return h.val } + +func (h *Hash) Roll(b byte) { + h.val = rotl(h.val, 1) ^ g[b] + if l := len(h.window); l < cap(h.window) { + h.window = append(h.window, b) + return + } + x0 := h.window[h.next] + h.val ^= g[x0] + h.window[h.next] = b + h.next++ + h.next %= cap(h.window) +} + +func rotl(x uint32, n int) uint32 { + n %= 32 + return x<>(32-n) +} diff --git a/cp32/cp32_test.go b/cp32/cp32_test.go new file mode 100644 index 0000000..baec085 --- /dev/null +++ b/cp32/cp32_test.go @@ -0,0 +1,78 @@ +package cp32 + +import ( + "encoding/binary" + "io" + "os" + "testing" +) + +func BenchmarkHash(b *testing.B) { + h := New(64) + b.ResetTimer() + for range b.N { + _, _ = h.Write([]byte("hello")) + } +} + +func TestHash(t *testing.T) { + cases := []struct { + name string + want uint32 + }{{ + name: "commonsense", want: 0xfd835584, + }, { + name: "empty", want: 0, + }, { + name: "one", want: 0x407d9eed, + }, { + name: "short", want: 0xb88e926a, + }} + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + h := New(64) + f, err := os.Open("../testdata/" + tc.name) + if err != nil { + t.Fatal(err) + } + defer f.Close() + + _, err = io.Copy(h, f) + if err != nil { + t.Fatal(err) + } + + got := h.Sum32() + if got != tc.want { + t.Errorf("got 0x%x, want 0x%x", got, tc.want) + } + }) + } +} + +// Tests that hashing string xS and then rolling on y (and rolling off x) is the same as hashing Sy. +func FuzzHash(f *testing.F) { + f.Fuzz(func(t *testing.T, a, b, c, d uint64, pre byte) { + var inp [32]byte + binary.Encode(inp[:], binary.LittleEndian, a) + binary.Encode(inp[8:], binary.LittleEndian, b) + binary.Encode(inp[16:], binary.LittleEndian, c) + binary.Encode(inp[24:], binary.LittleEndian, d) + + h1 := New(32) + h2 := New(32) + + h1.Write(inp[:]) + h2.WriteByte(pre) + h2.Write(inp[:len(inp)-1]) + h2.WriteByte(inp[len(inp)-1]) + + got1 := h1.Sum32() + got2 := h2.Sum32() + + if got1 != got2 { + t.Errorf("h1: 0x%x, h2: 0x%x (on input %x/%d)", got1, got2, inp[:], pre) + } + }) +} diff --git a/go.mod b/go.mod index f65126f..9183660 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,16 @@ -module github.com/bobg/hashsplit/v2 +module github.com/bobg/hashsplit/v3 go 1.23 -require github.com/chmduquesne/rollinghash v4.0.0+incompatible +require ( + github.com/bobg/go-generics/v4 v4.1.1 + github.com/bobg/seqs v1.2.0 + github.com/bradleyjkemp/cupaloy/v2 v2.8.0 + github.com/google/go-cmp v0.6.0 +) require ( github.com/bobg/go-generics/v3 v3.7.0 // indirect - github.com/bobg/seqs v1.2.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect ) diff --git a/go.sum b/go.sum index 2f8618e..de22dd0 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,22 @@ github.com/bobg/go-generics/v3 v3.7.0 h1:4SJHDWqONTRcA8al6491VW/ys6061bPCcTcI7YnIHPc= github.com/bobg/go-generics/v3 v3.7.0/go.mod h1:wGlMLQER92clsh3cJoQjbUtUEJ03FoxnGhZjaWhf4fM= +github.com/bobg/go-generics/v4 v4.1.1 h1:At0uu6D/VksvjPjxvYbWs3k4X1/aAFiTapr3kuiuuiM= +github.com/bobg/go-generics/v4 v4.1.1/go.mod h1:Oj7bxNHiEkq1PaCYmVA/dduJOsFnPnGV93NTkSrASI0= github.com/bobg/seqs v1.2.0 h1:y9SS1zisfkNQepd+xia/3ELDYR4T4vuLTyCA4UVOiKA= github.com/bobg/seqs v1.2.0/go.mod h1:icgB+vXIoU6s675tLYVAgcUYry1PkYwgEKvzOuFemOk= -github.com/chmduquesne/rollinghash v4.0.0+incompatible h1:hnREQO+DXjqIw3rUTzWN7/+Dpw+N5Um8zpKV0JOEgbo= -github.com/chmduquesne/rollinghash v4.0.0+incompatible/go.mod h1:Uc2I36RRfTAf7Dge82bi3RU0OQUmXT9iweIcPqvr8A0= +github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= +github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/hashsplit.go b/hashsplit.go index ab1ca72..a5072ba 100644 --- a/hashsplit.go +++ b/hashsplit.go @@ -7,8 +7,9 @@ import ( "io" "iter" "math/bits" + "sort" - "github.com/chmduquesne/rollinghash/buzhash32" + "github.com/bobg/hashsplit/v3/cp32" ) const ( @@ -51,6 +52,12 @@ type Splitter struct { // set this to 1. MinSize int + // MaxSize is the maximum chunk size. + // If it's zero, there is no maximum. + // This is the default. + // If it's some other value less than MinSize, then MinSize is used. + MaxSize int + // SplitBits is the number of trailing zero bits in the rolling checksum required to produce a chunk. // The default (what you get if you leave it set to zero) is 13, // which means a chunk boundary occurs on average once every 8,192 bytes. @@ -66,7 +73,7 @@ type Splitter struct { // This is the recommended rolling-checksum algorithm for hashsplitting // according to the document at github.com/hashsplit/hashsplit-spec // (presently in draft form). - rs *buzhash32.Buzhash32 + h *cp32.Hash } // Split hashsplits its input using a default Splitter. @@ -77,13 +84,9 @@ func Split(r io.Reader) (iter.Seq2[[]byte, int], *error) { } // NewSplitter produces a new Splitter. -// It may be customized before use by setting its MinSize and SplitBits fields. +// It may be customized before use by setting its MinSize, MaxSize, and SplitBits fields. func NewSplitter() *Splitter { - rs := buzhash32.New() - var zeroes [windowSize]byte - _, _ = rs.Write(zeroes[:]) // initialize the rolling checksum window - - return &Splitter{rs: rs} + return &Splitter{h: cp32.New(windowSize)} } // Split consumes the given input stream and hashsplits it, producing an iterator of chunk/level pairs. @@ -115,6 +118,11 @@ func (s *Splitter) Split(r io.Reader) (iter.Seq2[[]byte, int], *error) { minSize = defaultMinSize } + maxSize := s.MaxSize + if maxSize != 0 && maxSize < minSize { + maxSize = minSize + } + var err error f := func(yield func([]byte, int) bool) { @@ -133,11 +141,12 @@ func (s *Splitter) Split(r io.Reader) (iter.Seq2[[]byte, int], *error) { return } s.chunk = append(s.chunk, c) - s.rs.Roll(c) - if len(s.chunk) < minSize { + s.h.Roll(c) + chunkLen := len(s.chunk) + if chunkLen < minSize { continue } - if level, shouldSplit := s.checkSplit(); shouldSplit { + if level, shouldSplit := s.checkSplit(); shouldSplit || (maxSize != 0 && chunkLen >= maxSize) { if !yield(s.chunk, level) { return } @@ -154,9 +163,8 @@ func (s *Splitter) checkSplit() (int, bool) { if splitBits == 0 { splitBits = defaultSplitBits } - h := s.rs.Sum32() - tz := bits.TrailingZeros32(h) - if tz >= splitBits { + h := s.h.Sum32() + if tz := bits.TrailingZeros32(h); tz >= splitBits { return tz - splitBits, true } return 0, false @@ -326,17 +334,27 @@ type TreeNode struct { Chunks [][]byte } +// Pre produces an iterator over the nodes in the tree as a pre-order traversal. +func (n *TreeNode) Pre() iter.Seq[*TreeNode] { + return func(yield func(*TreeNode) bool) { + if !yield(n) { + return + } + for _, child := range n.Children { + for node := range child.Pre() { + if !yield(node) { + return + } + } + } + } +} + // AllChunks produces an iterator over all the chunks in the tree. -// It does this with a recursive tree walk starting at n. func (n *TreeNode) AllChunks() iter.Seq[[]byte] { return func(yield func([]byte) bool) { - for _, chunk := range n.Chunks { - if !yield(chunk) { - return - } - } - for _, child := range n.Children { - for chunk := range child.AllChunks() { + for n := range n.Pre() { + for _, chunk := range n.Chunks { if !yield(chunk) { return } @@ -350,7 +368,8 @@ var ErrNotFound = errors.New("not found") // Seek finds the level-0 node representing the given byte position // (i.e., the one where Offset <= pos < Offset+Size). -func Seek(n *TreeNode, pos uint64) (*TreeNode, error) { +// If the position is not found at or under the given node, Seek returns ErrNotFound. +func (n *TreeNode) Seek(pos uint64) (*TreeNode, error) { if pos < n.Offset || pos >= (n.Offset+n.Size) { return nil, ErrNotFound } @@ -360,15 +379,28 @@ func Seek(n *TreeNode, pos uint64) (*TreeNode, error) { return n, nil } - // TODO: if a Node kept track of its children's offsets, - // this loop could be replaced with a sort.Search call. - for _, child := range n.Children { - if pos >= (child.Offset + child.Size) { - continue + if false { + idx := sort.Search(num, func(i int) (ok bool) { + child := n.Children[i] + return pos < child.Offset+child.Size + }) + if idx == num { + // With a properly formed tree of nodes this will not be reached. + return nil, ErrNotFound } - return Seek(child, pos) - } + return n.Children[idx].Seek(pos) + } else { + // Surprisingly, the following code is faster than the sort.Search call above, + // at least in the case tested by BenchmarkSeek. - // With a properly formed tree of nodes this will not be reached. - return nil, ErrNotFound + for _, child := range n.Children { + if pos >= (child.Offset + child.Size) { + continue + } + return child.Seek(pos) + } + + // With a properly formed tree of nodes this will not be reached. + return nil, ErrNotFound + } } diff --git a/hashsplit_test.go b/hashsplit_test.go index 809f3ae..19d94d2 100644 --- a/hashsplit_test.go +++ b/hashsplit_test.go @@ -4,102 +4,119 @@ import ( "bytes" "encoding/json" "fmt" - "io" "os" + "path/filepath" "testing" + + "github.com/bobg/go-generics/v4/slices" + "github.com/bobg/seqs" + "github.com/bradleyjkemp/cupaloy/v2" + "github.com/google/go-cmp/cmp" ) -func TestSplit(t *testing.T) { - f, err := os.Open("testdata/commonsense.txt") +func TestSplitAndTree(t *testing.T) { + files, err := os.ReadDir("testdata") if err != nil { t.Fatal(err) } - defer f.Close() - - var i int - split, errptr := Split(f) - for chunk := range split { - i++ - want, err := os.ReadFile(fmt.Sprintf("testdata/chunk%02d", i)) - if err != nil { - t.Fatal(err) - } - if !bytes.Equal(chunk, want) { - t.Errorf("mismatch in chunk %d", i) + for _, file := range files { + path := filepath.Join("testdata", file.Name()) + if file.IsDir() { + continue } - } - if err := *errptr; err != nil { - t.Fatal(err) - } + for splitBits := 12; splitBits <= 14; splitBits++ { + minSizes := []int{0, 512 << (splitBits - 12)} + for _, minSize := range minSizes { + maxSizes := []int{0, 2500 << (splitBits - 12)} + for _, maxSize := range maxSizes { + name := fmt.Sprintf("%s-split%d", file.Name(), splitBits) + if minSize > 0 { + name += fmt.Sprintf("-min%d", minSize) + } + if maxSize > 0 { + name += fmt.Sprintf("-max%d", maxSize) + } + t.Run(name, func(t *testing.T) { + text, err := os.ReadFile(path) + if err != nil { + t.Fatal(err) + } - const wantChunks = 16 - if i != wantChunks { - t.Errorf("got %d chunks, want %d", i, wantChunks) - } -} + s := NewSplitter() + s.SplitBits = splitBits + s.MinSize = minSize + s.MaxSize = maxSize -func TestSplitFew(t *testing.T) { - for num := 0; num < 2; num++ { - var ( - inp = make([]byte, num) - got []byte - ) + split, errptr := s.Split(bytes.NewReader(text)) + pairs := slices.Collect(seqs.ToPairs(split)) + if err := *errptr; err != nil { + t.Fatal(err) + } - split, errptr := Split(bytes.NewReader(inp)) - for chunk := range split { - got = append(got, chunk...) - } - if err := *errptr; err != nil { - t.Fatal(err) - } - if len(got) != num { - t.Errorf("got %d byte(s), want %d", len(got), num) - } - } -} + snap := cupaloy.New(cupaloy.SnapshotSubdirectory("testdata/snapshots")) -func TestTree(t *testing.T) { - text, err := os.ReadFile("testdata/commonsense.txt") - if err != nil { - t.Fatal(err) - } + t.Run("split", func(t *testing.T) { + chunks := slices.Map(pairs, func(pair seqs.Pair[[]byte, int]) []byte { return pair.X }) - root, err := buildTree(text) - if err != nil { - t.Fatal(err) - } + if len(text) == 0 { + if len(chunks) != 0 { + t.Errorf("got %d chunks, want 0", len(chunks)) + } + return + } - if !compareTrees(root, wantTree) { - t.Fatal("tree mismatch") - } + sizes := slices.Map(chunks, func(chunk []byte) int { return len(chunk) }) + snap.SnapshotT(t, sizes) - var innerErr error + var got []byte + for _, chunk := range chunks { + got = append(got, chunk...) + } - pr, pw := io.Pipe() - go func() { - defer pw.Close() - for chunk := range root.AllChunks() { - _, innerErr = pw.Write(chunk) - if innerErr != nil { - return + if diff := cmp.Diff(string(text), string(got)); diff != "" { + t.Errorf("mismatch (-want +got):\n%s", diff) + } + }) + + t.Run("tree", func(t *testing.T) { + tree := Tree(seqs.FromPairs(slices.Values(pairs))) + root, ok := seqs.Last(seqs.Left(tree)) + if len(pairs) == 0 { + if ok { + t.Fatal("non-empty tree") + } + return + } + + if !ok { + t.Fatal("empty tree") + } + + var got []byte + for chunk := range root.AllChunks() { + got = append(got, chunk...) + } + + if diff := cmp.Diff(string(text), string(got)); diff != "" { + t.Errorf("mismatch (-want +got):\n%s", diff) + } + + for node := range root.Pre() { + for i := 0; i < len(node.Chunks); i++ { + node.Chunks[i] = nil + } + } + snap.SnapshotT(t, root) + }) + }) + } } } - }() - - reassembled, err := io.ReadAll(pr) - if err != nil { - t.Fatal(err) - } - if innerErr != nil { - t.Fatal(innerErr) - } - if !bytes.Equal(text, reassembled) { - t.Error("reassembled text does not match original") } } func TestSeek(t *testing.T) { - text, err := os.ReadFile("testdata/commonsense.txt") + text, err := os.ReadFile("testdata/commonsense") if err != nil { t.Fatal(err) } @@ -117,25 +134,25 @@ func TestSeek(t *testing.T) { }{{ name: "left end", pos: 0, - want: &TreeNode{Chunks: [][]byte{nil, nil}, Size: 35796}, + want: &TreeNode{Chunks: [][]byte{nil}, Size: 1864}, }, { name: "right end", - pos: 31483 + 116651 - 1, - want: &TreeNode{Chunks: [][]byte{nil, nil, nil}, Size: 31483, Offset: 116651}, + pos: 148133, + want: &TreeNode{Chunks: [][]byte{nil, nil, nil, nil, nil}, Offset: 109169, Size: 38965}, }, { name: "past the end", - pos: 31483 + 116651, + pos: 200000, want: nil, wanterr: true, }, { name: "in the middle", pos: 100000, - want: &TreeNode{Chunks: [][]byte{nil}, Size: 6775, Offset: 98993}, + want: &TreeNode{Chunks: [][]byte{nil, nil}, Offset: 92940, Size: 16229}, }} for _, c := range cases { t.Run(c.name, func(t *testing.T) { - got, err := Seek(root, c.pos) + got, err := root.Seek(c.pos) if c.wanterr { if err == nil { t.Error("wanted an error, got nil") @@ -152,8 +169,25 @@ func TestSeek(t *testing.T) { } } +func BenchmarkSeek(b *testing.B) { + text, err := os.ReadFile("testdata/commonsense") + if err != nil { + b.Fatal(err) + } + + root, err := buildTree(text) + if err != nil { + b.Fatal(err) + } + + b.ResetTimer() + for range b.N { + _, _ = root.Seek(100000) + } +} + func BenchmarkTree(b *testing.B) { - text, err := os.ReadFile("testdata/commonsense.txt") + text, err := os.ReadFile("testdata/commonsense") if err != nil { b.Fatal(err) } diff --git a/testdata/chunk01 b/testdata/chunk01 deleted file mode 100644 index f404a56..0000000 --- a/testdata/chunk01 +++ /dev/null @@ -1,160 +0,0 @@ - This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - -Title: Common Sense -Author: Thomas Paine -Release Date: June 9, 2008 [EBook #147] -Last updated: August 25, 2016 -Language: English -Character set encoding: UTF-8. - -Produced by John Campbell. HTML version by Al Haines. Modified by -Robert Homa. - -*** START OF THIS PROJECT GUTENBERG EBOOK COMMON SENSE *** - - -COMMON SENSE; - -addressed to the - -INHABITANTS - -of - -AMERICA, - -On the following interesting - -SUBJECTS - - Of the Origin and Design of Government in general, - with concise Remarks on the English Constitution. - Of Monarchy and Hereditary Succession - Thoughts on the present State of American Affairs - Of the present Ability of America, with some - miscellaneous Reflections - -A new edition, with several additions in the body of the work. To -which is added an appendix; together with an address to the people -called Quakers. - -Man knows no Master save creating Heaven -Or those whom choice and common good ordain. - -Thomson. - -PHILADELPHIA - -Printed and sold by W. & T. Bradford, February 14, 1776. - -MDCCLXXVI - - - -Common Sense -By Thomas Paine - - - - - -INTRODUCTION. - -Perhaps the sentiments contained in the following pages, are not yet -sufficiently fashionable to procure them general favor; a long habit -of not thinking a thing wrong, gives it a superficial appearance of -being right, and raises at first a formidable outcry in defense of -custom. But the tumult soon subsides. Time makes more converts than -reason. - -As a long and violent abuse of power, is generally the Means of -calling the right of it in question (and in Matters too which might -never have been thought of, had not the Sufferers been aggravated -into the inquiry) and as the King of England hath undertaken in his -own Right, to support the Parliament in what he calls Theirs, and as -the good people of this country are grievously oppressed by the -combination, they have an undoubted privilege to inquire into the -pretensions of both, and equally to reject the usurpation of either. - -In the following sheets, the author hath studiously avoided every -thing which is personal among ourselves. Compliments as well as -censure to individuals make no part thereof. The wise, and the -worthy, need not the triumph of a pamphlet; and those whose -sentiments are injudicious, or unfriendly, will cease of themselves -unless too much pains are bestowed upon their conversion. - -The cause of America is in a great measure the cause of all mankind. -Many circumstances hath, and will arise, which are not local, but -universal, and through which the principles of all Lovers of Mankind -are affected, and in the Event of which, their Affections are -interested. The laying a Country desolate with Fire and Sword, -declaring War against the natural rights of all Mankind, and -extirpating the Defenders thereof from the Face of the Earth, is the -Concern of every Man to whom Nature hath given the Power of feeling; -of which Class, regardless of Party Censure, is the - -AUTHOR - -P.S. The Publication of this new Edition hath been delayed, with a -View of taking notice (had it been necessary) of any Attempt to -refute the Doctrine of Independance: As no Answer hath yet appeared, -it is now presumed that none will, the Time needful for getting such -a Performance ready for the Public being considerably past. - -Who the Author of this Production is, is wholly unnecessary to the -Public, as the Object for Attention is the Doctrine itself, not the -Man. Yet it may not be unnecessary to say, That he is unconnected -with any Party, and under no sort of Influence public or private, -but the influence of reason and principle. - -Philadelphia, February 14, 1776 - - - -OF THE ORIGIN AND DESIGN OF GOVERNMENT IN GENERAL, -WITH CONCISE REMARKS ON THE ENGLISH CONSTITUTION. - -Some writers have so confounded society with government, as to leave -little or no distinction between them; whereas they are not only -different, but have different origins. Society is produced by our -wants, and government by our wickedness; the former promotes our -happiness positively by uniting our affections, the latter -negatively by restraining our vices. The one encourages intercourse, -the other creates distinctions. The first a patron, the last a -punisher. - -Society in every state is a blessing, but government even in its -best state is but a necessary evil; in its worst state an -intolerable one; for when we suffer, or are exposed to the same -miseries by a government, which we might expect in a country without -government, our calamity is heightened by reflecting that we furnish -the means by which we suffer. Government, like dress, is the badge -of lost innocence; the palaces of kings are built on the ruins of -the bowers of paradise. For were the impulses of conscience clear, -uniform, and irresistibly obeyed, man would need no other lawgiver; -but that not being the case, he finds it necessary to surrender up a -part of his property to furnish means for the protection of the rest; -and this he is induced to do by the same prudence which in every -other case advises him out of two evils to choose the least. -Wherefore, security being the true design and end of government, it -unanswerably follows that whatever form thereof appears most likely -to ensure it to us, with the least expence and greatest benefit, is -preferable to all others. - -In order to gain a clear and just idea of the design and end of -government, let us suppose a small number of persons settled in some -sequestered part of the earth, unconnected with the rest, they will -then represent the first peopling of any country, or of the world. -In this state of natural liberty, society will be their first -thought. A thousand motives will excite them thereto, the strength -of one man is so unequal to his wants, and his mind so unfitted for -perpetual solitude, that he is soon obliged to seek assistance and -relief of another, who in his turn requires the same. Four or five -united would be able to raise a tolerable dwelling in the midst of a -wilderness, but one man might labour out of the common period of -life without accomplishing any thing; when he had felled his timber -he could not remove it, nor erect it after it was removed; hunger in -the mean time would urge him from his work, and every di \ No newline at end of file diff --git a/testdata/chunk02 b/testdata/chunk02 deleted file mode 100644 index 70a17b5..0000000 --- a/testdata/chunk02 +++ /dev/null @@ -1,504 +0,0 @@ -fferent want -call him a different way. Disease, nay even misfortune would be -death, for though neither might be mortal, yet either would disable -him from living, and reduce him to a state in which he might rather -be said to perish than to die. - -Thus necessity, like a gravitating power, would soon form our newly -arrived emigrants into society, the reciprocal blessings of which, -would supersede, and render the obligations of law and government -unnecessary while they remained perfectly just to each other; but as -nothing but heaven is impregnable to vice, it will unavoidably -happen, that in proportion as they surmount the first difficulties -of emigration, which bound them together in a common cause, they -will begin to relax in their duty and attachment to each other; and -this remissness, will point out the necessity, of establishing some -form of government to supply the defect of moral virtue. - -Some convenient tree will afford them a State-House, under the -branches of which, the whole colony may assemble to deliberate on -public matters. It is more than probable that their first laws will -have the title only of Regulations, and be enforced by no other -penalty than public disesteem. In this first parliament every man, -by natural right, will have a seat. - -But as the colony increases, the public concerns will increase -likewise, and the distance at which the members may be separated, -will render it too inconvenient for all of them to meet on every -occasion as at first, when their number was small, their habitations -near, and the public concerns few and trifling. This will point out -the convenience of their consenting to leave the legislative part to -be managed by a select number chosen from the whole body, who are -supposed to have the same concerns at stake which those who -appointed them, and who will act in the same manner as the whole -body would act were they present. If the colony continue increasing, -it will become necessary to augment the number of the -representatives, and that the interest of every part of the colony -may be attended to, it will be found best to divide the whole into -convenient parts, each part sending its proper number; and that the -elected might never form to themselves an interest separate from the -electors, prudence will point out the propriety of having elections -often; because as the elected might by that means return and mix -again with the general body of the electors in a few months, their -fidelity to the public will be secured by the prudent reflexion of -not making a rod for themselves. And as this frequent interchange -will establish a common interest with every part of the community, -they will mutually and naturally support each other, and on this -(not on the unmeaning name of king) depends the strength of -government, and the happiness of the governed. - -Here then is the origin and rise of government; namely, a mode -rendered necessary by the inability of moral virtue to govern the -world; here too is the design and end of government, viz. freedom -and security. And however our eyes may be dazzled with show, or our -ears deceived by sound; however prejudice may warp our wills, or -interest darken our understanding, the simple voice of nature and of -reason will say, it is right. - -I draw my idea of the form of government from a principle in nature, -which no art can overturn, viz. that the more simple any thing is, -the less liable it is to be disordered; and the easier repaired when -disordered; and with this maxim in view, I offer a few remarks on -the so much boasted constitution of England. That it was noble for -the dark and slavish times in which it was erected, is granted. When -the world was over run with tyranny the least remove therefrom was a -glorious rescue. But that it is imperfect, subject to convulsions, -and incapable of producing what it seems to promise, is easily -demonstrated. - -Absolute governments (tho' the disgrace of human nature) have this -advantage with them, that they are simple; if the people suffer, -they know the head from which their suffering springs, know likewise -the remedy, and are not bewildered by a variety of causes and cures. -But the constitution of England is so exceedingly complex, that the -nation may suffer for years together without being able to discover -in which part the fault lies, some will say in one and some in -another, and every political physician will advise a different -medicine. - -I know it is difficult to get over local or long standing prejudices, -yet if we will suffer ourselves to examine the component parts of -the English constitution, we shall find them to be the base remains -of two ancient tyrannies, compounded with some new republican -materials. - -First.--The remains of monarchical tyranny in the person of the king. - -Secondly.--The remains of aristocratical tyranny in the persons of -the peers. - -Thirdly.--The new republican materials, in the persons of the -commons, on whose virtue depends the freedom of England. - -The two first, by being hereditary, are independent of the people; -wherefore in a constitutional sense they contribute nothing towards -the freedom of the state. - -To say that the constitution of England is a union of three powers -reciprocally checking each other, is farcical, either the words have -no meaning, or they are flat contradictions. - -To say that the commons is a check upon the king, presupposes two -things: - -First.--That the king is not to be trusted without being looked -after, or in other words, that a thirst for absolute power is the -natural disease of monarchy. - -Secondly.--That the commons, by being appointed for that purpose, -are either wiser or more worthy of confidence than the crown. - -But as the same constitution which gives the commons a power to -check the king by withholding the supplies, gives afterwards the -king a power to check the commons, by empowering him to reject their -other bills; it again supposes that the king is wiser than those -whom it has already supposed to be wiser than him. A mere absurdity! - -There is something exceedingly ridiculous in the composition of -monarchy; it first excludes a man from the means of information, yet -empowers him to act in cases where the highest judgment is required. -The state of a king shuts him from the world, yet the business of a -king requires him to know it thoroughly; wherefore the different -parts, by unnaturally opposing and destroying each other, prove the -whole character to be absurd and useless. - -Some writers have explained the English constitution thus; the king, -say they, is one, the people another; the peers are an house in -behalf of the king; the commons in behalf of the people; but this -hath all the distinctions of a house divided against itself; and -though the expressions be pleasantly arranged, yet when examined -they appear idle and ambiguous; and it will always happen, that the -nicest construction that words are capable of, when applied to the -description of some thing which either cannot exist, or is too -incomprehensible to be within the compass of description, will be -words of sound only, and though they may amuse the ear, they cannot -inform the mind, for this explanation includes a previous question, -viz. How came the king by a power which the people are afraid to -trust, and always obliged to check? Such a power could not be the -gift of a wise people, neither can any power, which needs checking, -be from God; yet the provision, which the constitution makes, -supposes such a power to exist. - -But the provision is unequal to the task; the means either cannot or -will not accomplish the end, and the whole affair is a felo de se; -for as the greater weight will always carry up the less, and as all -the wheels of a machine are put in motion by one, it only remains to -know which power in the constitution has the most weight, for that -will govern; and though the others, or a part of them, may clog, or, -as the phrase is, check the rapidity of its motion, yet so long as -they cannot stop it, their endeavors will be ineffectual; the first -moving power will at last have its way, and what it wants in speed -is supplied by time. - -That the crown is this overbearing part in the English constitution -needs not be mentioned, and that it derives its whole consequence -merely from being the giver of places and pensions is self-evident, -wherefore, though we have been wise enough to shut and lock a door -against absolute monarchy, we at the same time have been foolish -enough to put the crown in possession of the key. - -The prejudice of Englishmen, in favour of their own government by -king, lords and commons, arises as much or more from national pride -than reason. Individuals are undoubtedly safer in England than in -some other countries, but the will of the king is as much the law of -the land in Britain as in France, with this difference, that instead -of proceeding directly from his mouth, it is handed to the people -under the more formidable shape of an act of parliament. For the -fate of Charles the first, hath only made kings more subtle--not -more just. - -Wherefore, laying aside all national pride and prejudice in favour -of modes and forms, the plain truth is, that it is wholly owing to -the constitution of the people, and not to the constitution of the -government that the crown is not as oppressive in England as in -Turkey. - -An inquiry into the constitutional errors in the English form of -government is at this time highly necessary, for as we are never in -a proper condition of doing justice to others, while we continue -under the influence of some leading partiality, so neither are we -capable of doing it to ourselves while we remain fettered by any -obstinate prejudice. And as a man, who is attached to a prostitute, -is unfitted to choose or judge of a wife, so any prepossession in -favour of a rotten constitution of government will disable us from -discerning a good one. - - - -OF MONARCHY AND HEREDITARY SUCCESSION. - -Mankind being originally equals in the order of creation, the -equality could only be destroyed by some subsequent circumstance; -the distinctions of rich, and poor, may in a great measure be -accounted for, and that without having recourse to the harsh ill -sounding names of oppression and avarice. Oppression is often the -consequence, but seldom or never the means of riches; and though -avarice will preserve a man from being necessitously poor, it -generally makes him too timorous to be wealthy. - -But there is another and greater distinction for which no truly -natural or religious reason can be assigned, and that is, the -distinction of men into kings and subjects. Male and female are the -distinctions of nature, good and bad the distinctions of heaven; but -how a race of men came into the world so exalted above the rest, and -distinguished like some new species, is worth enquiring into, and -whether they are the means of happiness or of misery to mankind. - -In the early ages of the world, according to the scripture -chronology, there were no kings; the consequence of which was there -were no wars; it is the pride of kings which throw mankind into -confusion. Holland without a king hath enjoyed more peace for this -last century than any of the monarchial governments in Europe. -Antiquity favors the same remark; for the quiet and rural lives of -the first patriarchs hath a happy something in them, which vanishes -away when we come to the history of Jewish royalty. - -Government by kings was first introduced into the world by the -Heathens, from whom the children of Israel copied the custom. It was -the most prosperous invention the Devil ever set on foot for the -promotion of idolatry. The Heathens paid divine honors to their -deceased kings, and the christian world hath improved on the plan by -doing the same to their living ones. How impious is the title of -sacred majesty applied to a worm, who in the midst of his splendor -is crumbling into dust! - -As the exalting one man so greatly above the rest cannot be -justified on the equal rights of nature, so neither can it be -defended on the authority of scripture; for the will of the Almighty, -as declared by Gideon and the prophet Samuel, expressly disapproves -of government by kings. All anti-monarchical parts of scripture have -been very smoothly glossed over in monarchical governments, but they -undoubtedly merit the attention of countries which have their -governments yet to form. "Render unto Cæsar the things which are -Cæsar's" is the scripture doctrine of courts, yet it is no support -of monarchical government, for the Jews at that time were without a -king, and in a state of vassalage to the Romans. - -Near three thousand years passed away from the Mosaic account of the -creation, till the Jews under a national delusion requested a king. -Till then their form of government (except in extraordinary cases, -where the Almighty interposed) was a kind of republic administred by -a judge and the elders of the tribes. Kings they had none, and it -was held sinful to acknowledge any being under that title but the -Lord of Hosts. And when a man seriously reflects on the idolatrous -homage which is paid to the persons of Kings, he need not wonder, -that the Almighty ever jealous of his honor, should disapprove of a -form of government which so impiously invades the prerogative of -heaven. - -Monarchy is ranked in scripture as one of the sins of the Jews, for -which a curse in reserve is denounced against them. The history of -that transaction is worth attending to. - -The children of Israel being oppressed by the Midianites, Gideon -marched against them with a small army, and victory, thro' the -divine interposition, decided in his favour. The Jews elate with -success, and attributing it to the generalship of Gideon, proposed -making him a king, saying, Rule thou over us, thou and thy son and -thy son's son. Here was temptation in its fullest extent; not a -kingdom only, but an hereditary one, but Gideon in the piety of his -soul replied, I will not rule over you, neither shall my son rule -over you. The Lord shall rule over you. Words need not be more -explicit; Gideon doth not decline the honor, but denieth their right -to give it; neither doth he compliment them with invented -declarations of his thanks, but in the positive stile of a prophet -charges them with disaffection to their proper Sovereign, the King -of heaven. - -About one hundred and thirty years after this, they fell again into -the same error. The hankering which the Jews had for the idolatrous -customs of the Heathens, is something exceedingly unaccountable; but -so it was, that laying hold of the misconduct of Samuel's two sons, -who were entrusted with some secular concerns, they came in an -abrupt and clamorous manner to Samuel, saying, Behold thou art old, -and thy sons walk not in thy ways, now make us a king to judge us -like all other nations. And here we cannot but observe that their -motives were bad, viz. that they might be like unto other nations, -i.e. the Heathens, whereas their true glory laid in being as much -unlike them as possible. But the thing displeased Samuel when they -said, Give us a king to judge us; and Samuel prayed unto the Lord, -and the Lord said unto Samuel, Hearken unto the voice of the people -in all that they say unto thee, for they have not rejected thee, but -they have rejected me, THAT I SHOULD NOT REIGN OVER THEM. According -to all the works which they have done since the day that I brought -them up out of Egypt, even unto this day; wherewith they have -forsaken me and served other Gods; so do they also unto thee. Now -therefore hearken unto their voice, howbeit, protest solemnly unto -them and shew them the manner of the king that shall reign over them, -i.e. not of any particular king, but the general manner of the kings -of the earth, whom Israel was so eagerly copying after. And -notwithstanding the great distance of time and difference of manners, -the character is still in fashion. And Samuel told all the words of -the Lord unto the people, that asked of him a king. And he said, -This shall be the manner of the king that shall reign over you; he -will take your sons and appoint them for himself, for his chariots, -and to be his horsemen, and some shall run before his chariots (this -description agrees with the present mode of impressing men) and he -will appoint him captains over thousands and captains over fifties, -and will set them to ear his ground and to reap his harvest, and to -make his instruments of war, and instruments of his chariots; and he -will take your daughters to be confectionaries, and to be cooks and -to be bakers (this describes the expence and luxury as well as the -oppression of kings) and he will take your fields and your olive -yards, even the best of them, and give them to his servants; and he -will take the tenth of your feed, and of your vineyards, and give -them to his officers and to his servants (by which we see that -bribery, corruption and favoritism are the standing vices of kings) -and he will take the tenth of your men servants, and your maid -servants, and your goodliest young men and your asses, and put them -to his work; and he will take the tenth of your sheep, and ye shall -be his servants, and ye shall cry out in that day because of your -king which ye shall have chosen, and the Lord will not hear you in -that day. This accounts for the continuation of monarchy; neither do -the characters of the few good kings which have lived since, either -sanctify the title, or blot out the sinfulness of the origin; the -high encomium given of David takes no notice of him officially as a -king, but only as a man after God's own heart. Nevertheless the -People refused to obey the voice of Samuel, and they said, Nay, but -we will have a king over us, that we may be like all the nations, -and that our king may judge us, and go out before us, and fight our -battles. Samuel continued to reason with them, but to no purpose; he -set before them their ingratitude, but all would not avail; and -seeing them fully bent on their folly, he cried out, I will call -unto the Lord, and he shall send thunder and rain (which then was a -punishment, being in the time of wheat harvest) that ye may perceive -and see that your wickedness is great which ye have done in the -sight of the Lord, in asking you a king. So Samuel called unto the -Lord, and the Lord sent thunder and rain that day, and all the -people greatly feared the Lord and Samuel. And all the people said -unto Samuel, Pray for thy servants unto the Lord thy God that we die -not, for we have added unto our sins this evil, to ask a king. These -portions of scripture are direct and positive. They admit of no -equivocal construction. That the Almighty hath here entered his -protest against monarchical government is true, or the scripture is -false. And a man hath good reason to believe that there is as much -of king-craft, as priest-craft, in withholding the scripture from -the public in Popish countries. For monarchy in every instance is -the Popery of government. - -To the evil of monarchy we have added that of hereditary succession; -and as the first is a degradation and lessening of ourselves, so the -second, claimed as a matter of right, is an insult and an imposition -on posterity. For all men being originally equals, no one by birth -could have a right to set up his own family in perpetual preference -to all others for ever, and though himself might deserve some decent -degree of honors of his cotemporaries, yet his descendants might be -far too unworthy to inherit them. One of the strongest natural -proofs of the folly of hereditary right in kings, is, that nature -disapproves it, otherwise she would not so frequently turn it into -ridicule by giving mankind an ass for a lion. - -Secondly, as no man at first could possess any other public honors -than were bestowed upon him, so the givers of those honors could -have no power to give away the right of posterity, and though they -might say "We choose you for our head," they could not, without -manifest injustice to their children, say "that your children and -your children's children shall reign over ours for ever." Because -such an unwise, unjust, unnatural compact might (perhaps) in the -next succession put them under the government of a rogue or a fool. -Most wise men, in their private sentiments, have ever treated -hereditary right with contempt; yet it is one of those evils, which -when once established is not easily removed; many submit from fear, -others from superstition, and the more powerful part shares with the -king the plunder of the rest. - -This is supposing the present race of kings in the world to have had -an honorable origin; whereas it is more than probable, that could we -take off the dark covering of antiquity, and trace them to their -first rise, that we should find the first of them nothing better -than the principal ruffian of some restless gang, whose savage -manners or pre-eminence in subtility obtained him the title of chief -among plunderers; and who by increasing in power, and extending his -depredations, over-awed the quiet and defenceless to purchase their -safety by frequent contributions. Yet his electors could have no -idea of giving hereditary right to his descendants, because such a -perpetual exclusion of themselves was incompatible with the free and -unrestrained principles they professed to live by. Wherefore, -hereditary succession in the early ages of monarchy could not take -place as a matter of claim, but as something casual or complimental; -but as few or no records were extant in those days, and traditional -history stuffed with fables, it was very easy, after the lapse of a -few generations, to trump up some superstitious tale, conveniently -timed, Mahomet like, to cram hereditary right down the throats of -the vulgar. Perhaps the disorders which threatened, or seemed to -threaten, on the decease of a leader and the choice of a new one -(for elections among ruffians could not be very orderly) induced -many at first to favor hereditary pretensions; by which means it -happened, as it hath happened since, that what at first was -submitted to as a convenience, was afterwards claimed as a right. - -England, since the conquest, hath known some few good monarchs, but -groaned beneath a much larger number of bad ones; yet no man in his -senses can say that their claim under William the Conqueror is a -very honorable one. A French bastard landing with an armed banditti, -and establishing himself king of England against the consent of the -natives, is in plain terms a very paltry rascally original.--It -certainly hath no divinity in it. However, it is needless to spend -much time in exposing the folly of hereditary right; if there are -any so weak as to believe it, let them promiscuously worship the ass -and lion, and welcome. I shall neither copy their humility, nor -disturb their devotion. - -Yet I should be glad to ask how they suppose kings came at first? -The question admits but of three answers, viz. either by lot, by -election, or by usurpation. If the first king was taken by lot, it -establishes a precedent for the next, which excludes hereditary -succession. Saul was by lot, yet the succession was not hereditary, -neither does it appear from that transaction there was any intention -it ever should. If the first king of any country was by election, -that likewise establishes a precedent for the next; for to say, that -the right of all future generations is taken away, by the act of the -first electors, in their choice not only of a king, but of a family -of kings for ever, hath no parrallel in or out of scripture but the -doctrine of original sin, which supposes the free will of all men -lost in Adam; and from such comparison, and it will admit of no -other, hereditary succession can derive no glory. For as in Adam all -sinned, and as in the first electors all men obeyed; as in the one -all mankind were subjected to Satan, and in the other to Sovereignty; -as our innocence was lost in the first, and our authority in the -last; and as both disable us from reassuming some former state and -privilege, it unanswerably follows that original sin and hereditary -succession are parellels. Dishonorable rank! Inglorious connexion! -Yet the most subtile sophist cannot produce a juster simile. - -As to usurpation, no man will be so hardy as to defend it; and that -William the Conqueror was an usurper is a fact not to be -contradicted. The plain truth is, that the antiquity of English -monarchy will not bear looking into. - -But it is not so much the absurdity as the evil of hereditary -succession which concerns mankind. Did it ensure a race of good and -wise men it would have the seal of divine authority, but as it opens -a door to the foolish, the wicked, and the improper, it hath in it -the nature of oppression. Men who look upon themselves born to reign, -and others to obey, soon grow insolent; selected from the rest of -mankind their minds are early poisoned by importance; and the world -they act in differs so materially from the world at large, that they -have but little opportunity of knowing its true interests, and when -they succeed to the government are frequently the most ignorant and -unfit of any throughout the dominions. - -Another evil which attends hereditary succession is, that the throne -is subject to be possessed by a minor at any age; all which time the -regency, acting under the cover of a king, have every opportunity -and inducement to betray their trust. The same national misfortune -happens, when a king worn out with age and infirmity, enters the -last stage of human weakness. In both these cases the public becomes -a prey to every miscreant, who can tamper successfully with the -follies either of age or infancy. - -The most plausible plea, which hath ever been offered in favour of -hereditary succession, is, that it preserves a nation from civil -wars; and were this true, it would be weighty; whereas, it is the -most barefaced falsity ever imposed upon mankind. The whole history -of England disowns the fact. Thirty kings and two minors have -reigned in that distracted kingdom since the conquest, in which time -there have been (including the Revolution) no less than eight civil -wars and nineteen rebellions. Wherefore instead of making for peace, -it makes against it, and destroys the very foundation it seems to -stand on. - -The contest for monarchy and succession, between the houses of York -and Lancaster, laid England in a scene of blood for many years. -Twelve pitched battles, besides skirmishes and sieges, were fought -between Henry and Edward. Twice was Henry prisoner to Edward, who in -his turn was prisoner to Henry. And so uncertain is the fate of war -and the temper of a nation, when nothing but personal matters are -the ground of a quarrel, that Henry was taken in triumph from a -prison to a palace, and Edward obliged to fly from a palace to a -foreign land; yet, as sudden transitions of temper are seldom -lasting, Henry in his turn was driven from the throne, and Edward -recalled to succeed him. The parliament always following the -strongest side. - -This contest began in the reign of Henry the Sixth, and was not -entirely extinguished till Henry the Seventh, in whom the families -were united. Including a period of 67 years, viz. from 1422 to 1489. - -In short, monarchy and succession have laid (not this or that -kingdom only) but the world in blood and ashes. 'Tis a form of -government which the word of God bears testimony against, and blood -will attend it. - -If we inquire into the business of a king, we shall find that in -some countries they have none; and after sauntering away their lives -without pleasure to themselves or advantage to the nation, withdraw -from the scene, and leave their successors to tread the same idle -round. In absolute monarchies the whole weight of business, civil -and military, lies on the king; the children of Israel in their -request for a king, urged this plea "that he may judge us, and go -out before us and fight our battles." But in countries where he is -neither a judge nor a general, as in England, a man would be puzzled -to know what is his business. - -The nearer any government approaches to a republic the less business -there is for a king. It is somewhat difficult to find a proper name -for the government of England. Sir William Meredith calls it a -republic; but in its present state it is unworthy of the name, -because the corrupt influence of the crown, by having all the places -in its disposal, hath so effectually swallowed up the power, and -eaten out the virtue of the house of commons (the republican part in -the constitution) that the government of England is nearly as -monarchical as that of France or Spain. Men fall out with names -without understanding them. For it is the republican and not the -monarchical part of the constitu \ No newline at end of file diff --git a/testdata/chunk03 b/testdata/chunk03 deleted file mode 100644 index 1f5e2f8..0000000 --- a/testdata/chunk03 +++ /dev/null @@ -1,141 +0,0 @@ -tion of England which Englishmen -glory in, viz. the liberty of choosing a house of commons from out -of their own body--and it is easy to see that when republican virtue -fails, slavery ensues. Why is the constitution of England sickly, -but because monarchy hath poisoned the republic, the crown hath -engrossed the commons? - -In England a king hath little more to do than to make war and give -away places; which in plain terms, is to impoverish the nation and -set it together by the ears. A pretty business indeed for a man to -be allowed eight hundred thousand sterling a year for, and -worshipped into the bargain! Of more worth is one honest man to -society and in the sight of God, than all the crowned ruffians that -ever lived. - - - -THOUGHTS ON THE PRESENT STATE OF AMERICAN AFFAIRS. - -In the following pages I offer nothing more than simple facts, plain -arguments, and common sense; and have no other preliminaries to -settle with the reader, than that he will divest himself of -prejudice and prepossession, and suffer his reason and his feelings -to determine for themselves; that he will put on, or rather that he -will not put off, the true character of a man, and generously -enlarge his views beyond the present day. - -Volumes have been written on the subject of the struggle between -England and America. Men of all ranks have embarked in the -controversy, from different motives, and with various designs; but -all have been ineffectual, and the period of debate is closed. Arms, -as the last resource, decide the contest; the appeal was the choice -of the king, and the continent hath accepted the challenge. - -It hath been reported of the late Mr. Pelham (who tho' an able -minister was not without his faults) that on his being attacked in -the house of commons, on the score, that his measures were only of a -temporary kind, replied "they will last my time." Should a thought -so fatal and unmanly possess the colonies in the present contest, -the name of ancestors will be remembered by future generations with -detestation. - -The sun never shined on a cause of greater worth. 'Tis not the -affair of a city, a country, a province, or a kingdom, but of a -continent--of at least one eighth part of the habitable globe. 'Tis -not the concern of a day, a year, or an age; posterity are virtually -involved in the contest, and will be more or less affected, even to -the end of time, by the proceedings now. Now is the seed time of -continental union, faith and honor. The least fracture now will be -like a name engraved with the point of a pin on the tender rind of a -young oak; the wound will enlarge with the tree, and posterity read -it in full grown characters. - -By referring the matter from argument to arms, a new æra for -politics is struck; a new method of thinking hath arisen. All plans, -proposals, &c. prior to the nineteenth of April, i.e. to the -commencement of hostilities, are like the almanacks of the last year; -which, though proper then, are superseded and useless now. Whatever -was advanced by the advocates on either side of the question then, -terminated in one and the same point, viz. a union with Great- -Britain; the only difference between the parties was the method of -effecting it; the one proposing force, the other friendship; but it -hath so far happened that the first hath failed, and the second hath -withdrawn her influence. - -As much hath been said of the advantages of reconciliation, which, -like an agreeable dream, hath passed away and left us as we were, it -is but right, that we should examine the contrary side of the -argument, and inquire into some of the many material injuries which -these colonies sustain, and always will sustain, by being connected -with, and dependant on Great-Britain. To examine that connexion and -dependance, on the principles of nature and common sense, to see -what we have to trust to, if separated, and what we are to expect, -if dependant. - -I have heard it asserted by some, that as America hath flourished -under her former connexion with Great-Britain, that the same -connexion is necessary towards her future happiness, and will always -have the same effect. Nothing can be more fallacious than this kind -of argument. We may as well assert that because a child has thrived -upon milk, that it is never to have meat, or that the first twenty -years of our lives is to become a precedent for the next twenty. But -even this is admitting more than is true, for I answer roundly, that -America would have flourished as much, and probably much more, had -no European power had any thing to do with her. The commerce, by -which she hath enriched herself are the necessaries of life, and -will always have a market while eating is the custom of Europe. - -But she has protected us, say some. That she has engrossed us is -true, and defended the continent at our expence as well as her own -is admitted, and she would have defended Turkey from the same motive, -viz. the sake of trade and dominion. - -Alas, we have been long led away by ancient prejudices, and made -large sacrifices to superstition. We have boasted the protection of -Great-Britain, without considering, that her motive was interest not -attachment; that she did not protect us from our enemies on our -account, but from her enemies on her own account, from those who had -no quarrel with us on any other account, and who will always be our -enemies on the same account. Let Britain wave her pretensions to the -continent, or the continent throw off the dependance, and we should -be at peace with France and Spain were they at war with Britain. The -miseries of Hanover last war ought to warn us against connexions. - -It has lately been asserted in parliament, that the colonies have no -relation to each other but through the parent country, i.e. that -Pennsylvania and the Jerseys, and so on for the rest, are sister -colonies by the way of England; this is certainly a very round-about -way of proving relationship, but it is the nearest and only true way -of proving enemyship, if I may so call it. France and Spain never -were, nor perhaps ever will be our enemies as Americans, but as our -being the subjects of Great-Britain. - -But Britain is the parent country, say some. Then the more shame -upon her conduct. Even brutes do not devour their young, nor savages -make war upon their families; wherefore the assertion, if true, -turns to her reproach; but it happens not to be true, or only partly -so, and the phrase parent or mother country hath been jesuitically -adopted by the king and his parasites, with a low papistical design -of gaining an unfair bias on the credulous weakness of our minds. -Europe, and not England, is the parent country of America. This new -world hath been the asylum for the persecuted lovers of civil and -religious liberty from every part of Europe. Hither have they fled, -not from the tender embraces of the mother, but from the cruelty of -the monster; and it is so far true of England, that the same tyranny -which drove the first emigrants from home, pursues their descendants -still. - -In this extensive quarter of the globe, we forget the narrow limits -of three hundred and sixty miles (the extent of England) and carry -our friendship on a larger scale; we claim brotherhood with every -European christian, and triumph in the generosity of the sentiment. - -It is pleasant to observe by what regular gradations we surmount the -force of local prejudice, as we enlarge our acquaintance with the -world. A man born in any town in England divided into parishes, will -naturally associate most with his fellow parishioners (because their -interests in many cases will be common) and distinguish him by the -name of neighbour; if he meet him but a few miles from home, he -drops the narrow idea of a street, and salutes him by the name of -townsman; if he travel out \ No newline at end of file diff --git a/testdata/chunk04 b/testdata/chunk04 deleted file mode 100644 index bdc704e..0000000 --- a/testdata/chunk04 +++ /dev/null @@ -1,377 +0,0 @@ -of the county, and meet him in any other, -he forgets the minor divisions of street and town, and calls him -countryman, i.e. county-man; but if in their foreign excursions they -should associate in France or any other part of Europe, their local -remembrance would be enlarged into that of Englishmen. And by a just -parity of reasoning, all Europeans meeting in America, or any other -quarter of the globe, are countrymen; for England, Holland, Germany, -or Sweden, when compared with the whole, stand in the same places on -the larger scale, which the divisions of street, town, and county do -on the smaller ones; distinctions too limited for continental minds. -Not one third of the inhabitants, even of this province, are of -English descent. Wherefore I reprobate the phrase of parent or -mother country applied to England only, as being false, selfish, -narrow and ungenerous. - -But admitting, that we were all of English descent, what does it -amount to? Nothing. Britain, being now an open enemy, extinguishes -every other name and title: And to say that reconciliation is our -duty, is truly farcical. The first king of England, of the present -line (William the Conqueror) was a Frenchman, and half the Peers of -England are descendants from the same country; therefore, by the -same method of reasoning, England ought to be governed by France. - -Much hath been said of the united strength of Britain and the -colonies, that in conjunction they might bid defiance to the world. -But this is mere presumption; the fate of war is uncertain, neither -do the expressions mean any thing; for this continent would never -suffer itself to be drained of inhabitants, to support the British -arms in either Asia, Africa, or Europe. - -Besides what have we to do with setting the world at defiance? Our -plan is commerce, and that, well attended to, will secure us the -peace and friendship of all Europe; because, it is the interest of -all Europe to have America a free port. Her trade will always be a -protection, and her barrenness of gold and silver secure her from -invaders. - -I challenge the warmest advocate for reconciliation, to shew, a -single advantage that this continent can reap, by being connected -with Great Britain. I repeat the challenge, not a single advantage -is derived. Our corn will fetch its price in any market in Europe, -and our imported goods must be paid for buy them where we will. - -But the injuries and disadvantages we sustain by that connection, -are without number; and our duty to mankind at large, as well as to -ourselves, instruct us to renounce the alliance: Because, any -submission to, or dependance on Great-Britain, tends directly to -involve this continent in European wars and quarrels; and sets us at -variance with nations, who would otherwise seek our friendship, and -against whom, we have neither anger nor complaint. As Europe is our -market for trade, we ought to form no partial connection with any -part of it. It is the true interest of America to steer clear of -European contentions, which she never can do, while by her -dependence on Britain, she is made the make-weight in the scale of -British politics. - -Europe is too thickly planted with kingdoms to be long at peace, and -whenever a war breaks out between England and any foreign power, the -trade of America goes to ruin, because of her connection with -Britain. The next war may not turn out like the last, and should it -not, the advocates for reconciliation now will be wishing for -separation then, because, neutrality in that case, would be a safer -convoy than a man of war. Every thing that is right or natural -pleads for separation. The blood of the slain, the weeping voice of -nature cries, 'Tis time to part. Even the distance at which the -Almighty hath placed England and America, is a strong and natural -proof, that the authority of the one, over the other, was never the -design of Heaven. The time likewise at which the continent was -discovered, adds weight to the argument, and the manner in which it -was peopled encreases the force of it. The reformation was preceded -by the discovery of America, as if the Almighty graciously meant to -open a sanctuary to the persecuted in future years, when home should -afford neither friendship nor safety. - -The authority of Great-Britain over this continent, is a form of -government, which sooner or later must have an end: And a serious -mind can draw no true pleasure by looking forward, under the painful -and positive conviction, that what he calls "the present -constitution" is merely temporary. As parents, we can have no joy, -knowing that this government is not sufficiently lasting to ensure -any thing which we may bequeath to posterity: And by a plain method -of argument, as we are running the next generation into debt, we -ought to do the work of it, otherwise we use them meanly and -pitifully. In order to discover the line of our duty rightly, we -should take our children in our hand, and fix our station a few -years farther into life; that eminence will present a prospect, -which a few present fears and prejudices conceal from our sight. - -Though I would carefully avoid giving unnecessary offence, yet I am -inclined to believe, that all those who espouse the doctrine of -reconciliation, may be included within the following descriptions. -Interested men, who are not to be trusted; weak men, who cannot see; -prejudiced men, who will not see; and a certain set of moderate men, -who think better of the European world than it deserves; and this -last class, by an ill-judged deliberation, will be the cause of more -calamities to this continent, than all the other three. - -It is the good fortune of many to live distant from the scene of -sorrow; the evil is not sufficient brought to their doors to make -them feel the precariousness with which all American property is -possessed. But let our imaginations transport us for a few moments -to Boston, that seat of wretchedness will teach us wisdom, and -instruct us for ever to renounce a power in whom we can have no -trust. The inhabitants of that unfortunate city, who but a few -months ago were in ease and affluence, have now, no other -alternative than to stay and starve, or turn out to beg. Endangered -by the fire of their friends if they continue within the city, and -plundered by the soldiery if they leave it. In their present -condition they are prisoners without the hope of redemption, and in -a general attack for their relief, they would be exposed to the fury -of both armies. - -Men of passive tempers look somewhat lightly over the offences of -Britain, and, still hoping for the best, are apt to call out, "Come, -come, we shall be friends again, for all this." But examine the -passions and feelings of mankind, Bring the doctrine of -reconciliation to the touchstone of nature, and then tell me, -whether you can hereafter love, honour, and faithfully serve the -power that hath carried fire and sword into your land? If you cannot -do all these, then are you only deceiving yourselves, and by your -delay bringing ruin upon posterity. Your future connection with -Britain, whom you can neither love nor honour, will be forced and -unnatural, and being formed only on the plan of present convenience, -will in a little time fall into a relapse more wretched than the -first. But if you say, you can still pass the violations over, then -I ask, Hath your house been burnt? Hath your property been destroyed -before your face? Are your wife and children destitute of a bed to -lie on, or bread to live on? Have you lost a parent or a child by -their hands, and yourself the ruined and wretched survivor? If you -have not, then are you not a judge of those who have. But if you -have, and still can shake hands with the murderers, then are you -unworthy of the name of husband, father, friend, or lover, and -whatever may be your rank or title in life, you have the heart of a -coward, and the spirit of a sycophant. - -This is not inflaming or exaggerating matters, but trying them by -those feelings and affections which nature justifies, and without -which, we should be incapable of discharging the social duties of -life, or enjoying the felicities of it. I mean not to exhibit horror -for the purpose of provoking revenge, but to awaken us from fatal -and unmanly slumbers, that we may pursue determinately some fixed -object. It is not in the power of Britain or of Europe to conquer -America, if she do not conquer herself by delay and timidity. The -present winter is worth an age if rightly employed, but if lost or -neglected, the whole continent will partake of the misfortune; and -there is no punishment which that man will not deserve, be he who, -or what, or where he will, that may be the means of sacrificing a -season so precious and useful. - -It is repugnant to reason, to the universal order of things to all -examples from former ages, to suppose, that this continent can -longer remain subject to any external power. The most sanguine in -Britain does not think so. The utmost stretch of human wisdom cannot, -at this time, compass a plan short of separation, which can promise -the continent even a year's security. Reconciliation is now a -fallacious dream. Nature hath deserted the connexion, and Art cannot -supply her place. For, as Milton wisely expresses, "never can true -reconcilement grow where wounds of deadly hate have pierced so -deep." - -Every quiet method for peace hath been ineffectual. Our prayers have -been rejected with disdain; and only tended to convince us, that -nothing flatters vanity, or confirms obstinacy in Kings more than -repeated petitioning--and nothing hath contributed more than that -very measure to make the Kings of Europe absolute: Witness Denmark -and Sweden. Wherefore, since nothing but blows will do, for God's -sake, let us come to a final separation, and not leave the next -generation to be cutting throats, under the violated unmeaning names -of parent and child. - -To say, they will never attempt it again is idle and visionary, we -thought so at the repeal of the stamp-act, yet a year or two -undeceived us; as well may we suppose that nations, which have been -once defeated, will never renew the quarrel. - -As to government matters, it is not in the power of Britain to do -this continent justice: The business of it will soon be too weighty, -and intricate, to be managed with any tolerable degree of -convenience, by a power, so distant from us, and so very ignorant of -us; for if they cannot conquer us, they cannot govern us. To be -always running three or four thousand miles with a tale or a -petition, waiting four or five months for an answer, which when -obtained requires five or six more to explain it in, will in a few -years be looked upon as folly and childishness--There was a time -when it was proper, and there is a proper time for it to cease. - -Small islands not capable of protecting themselves, are the proper -objects for kingdoms to take under their care; but there is -something very absurd, in supposing a continent to be perpetually -governed by an island. In no instance hath nature made the satellite -larger than its primary planet, and as England and America, with -respect to each other, reverses the common order of nature, it is -evident they belong to different systems: England to Europe, America -to itself. - -I am not induced by motives of pride, party, or resentment to -espouse the doctrine of separation and independance; I am clearly, -positively, and conscientiously persuaded that it is the true -interest of this continent to be so; that every thing short of that -is mere patchwork, that it can afford no lasting felicity,--that it -is leaving the sword to our children, and shrinking back at a time, -when, a little more, a little farther, would have rendered this -continent the glory of the earth. - -As Britain hath not manifested the least inclination towards a -compromise, we may be assured that no terms can be obtained worthy -the acceptance of the continent, or any ways equal to the expence of -blood and treasure we have been already put to. - -The object, contended for, ought always to bear some just proportion -to the expence. The removal of North, or the whole detestable junto, -is a matter unworthy the millions we have expended. A temporary -stoppage of trade, was an inconvenience, which would have -sufficiently ballanced the repeal of all the acts complained of, had -such repeals been obtained; but if the whole continent must take up -arms, if every man must be a soldier, it is scarcely worth our while -to fight against a contemptible ministry only. Dearly, dearly, do we -pay for the repeal of the acts, if that is all we fight for; for in -a just estimation, it is as great a folly to pay a Bunker-hill price -for law, as for land. As I have always considered the independancy -of this continent, as an event, which sooner or later must arrive, -so from the late rapid progress of the continent to maturity, the -event could not be far off. Wherefore, on the breaking out of -hostilities, it was not worth the while to have disputed a matter, -which time would have finally redressed, unless we meant to be in -earnest; otherwise, it is like wasting an estate on a suit at law, -to regulate the trespasses of a tenant, whose lease is just expiring. -No man was a warmer wisher for reconciliation than myself, before -the fatal nineteenth of April 1775, but the moment the event of that -day was made known, I rejected the hardened, sullen tempered Pharaoh -of England for ever; and disdain the wretch, that with the pretended -title of father of his people can unfeelingly hear of their -slaughter, and composedly sleep with their blood upon his soul. - -But admitting that matters were now made up, what would be the event? -I answer, the ruin of the continent. And that for several reasons. - -First. The powers of governing still remaining in the hands of the -king, he will have a negative over the whole legislation of this -continent. And as he hath shewn himself such an inveterate enemy to -liberty, and discovered such a thirst for arbitrary power; is he, or -is he not, a proper man to say to these colonies, "You shall make no -laws but what I please." And is there any inhabitant in America so -ignorant, as not to know, that according to what is called the -present constitution, that this continent can make no laws but what -the king gives leave to; and is there any man so unwise, as not to -see, that (considering what has happened) he will suffer no law to -be made here, but such as suit his purpose. We may be as effectually -enslaved by the want of laws in America, as by submitting to laws -made for us in England. After matters are made up (as it is called) -can there be any doubt, but the whole power of the crown will be -exerted, to keep this continent as low and humble as possible? -Instead of going forward we shall go backward, or be perpetually -quarrelling or ridiculously petitioning.--We are already greater -than the king wishes us to be, and will he not hereafter endeavour -to make us less? To bring the matter to one point. Is the power who -is jealous of our prosperity, a proper power to govern us? Whoever -says No to this question is an independant, for independancy means -no more, than, whether we shall make our own laws, or whether the -king, the greatest enemy this continent hath, or can have, shall -tell us "there shall be no laws but such as I like." - -But the king you will say has a negative in England; the people -there can make no laws without his consent. In point of right and -good order, there is something very ridiculous, that a youth of -twenty-one (which hath often happened) shall say to several millions -of people, older and wiser than himself, I forbid this or that act -of yours to be law. But in this place I decline this sort of reply, -though I will never cease to expose the absurdity of it, and only -answer, that England being the King's residence, and America not so, -makes quite another case. The king's negative here is ten times more -dangerous and fatal than it can be in England, for there he will -scarcely refuse his consent to a bill for putting England into as -strong a state of defence as possible, and in America he would never -suffer such a bill to be passed. - -America is only a secondary object in the system of British politics, -England consults the good of this country, no farther than it -answers her own purpose. Wherefore, her own interest leads her to -suppress the growth of ours in every case which doth not promote her -advantage, or in the least interferes with it. A pretty state we -should soon be in under such a second-hand government, considering -what has happened! Men do not change from enemies to friends by the -alteration of a name: And in order to shew that reconciliation now -is a dangerous doctrine, I affirm, that it would be policy in the -king at this time, to repeal the acts for the sake of reinstating -himself in the government of the provinces; in order, that he may -accomplish by craft and subtilty, in the long run, what he cannot do -by force and violence in the short one. Reconciliation and ruin are -nearly related. - -Secondly. That as even the best terms, which we can expect to obtain, -can amount to no more than a temporary expedient, or a kind of -government by guardianship, which can last no longer than till the -colonies come of age, so the general face and state of things, in -the interim, will be unsettled and unpromising. Emigrants of -property will not choose to come to a country whose form of -government hangs but by a thread, and who is every day tottering on -the brink of commotion and disturbance; and numbers of the present -inhabitants would lay hold of the interval, to dispense of their -effects, and quit the continent. - -But the most powerful of all arguments, is, that nothing but -independance, i.e. a continental form of government, can keep the -peace of the continent and preserve it inviolate from civil wars. I -dread the event of a reconciliation with Britain now, as it is more -than probable, that it will be followed by a revolt somewhere or -other, the consequences of which may be far more fatal than all the -malice of Britain. - -Thousands are already ruined by British barbarity; (thousands more -will probably suffer the same fate) Those men have other feelings -than us who have nothing suffered. All they now possess is liberty, -what they before enjoyed is sacrificed to its service, and having -nothing more to lose, they disdain submission. Besides, the general -temper of the colonies, towards a British government, will be like -that of a youth, who is nearly out of his time; they will care very -little about her. And a government which cannot preserve the peace, -is no government at all, and in that case we pay our money for -nothing; and pray what is it that Britain can do, whose power will -be wholly on paper, should a civil tumult break out the very day -after reconciliation? I have heard some men say, many of whom I -believe spoke without thinking, that they dreaded an independance, -fearing that it would produce civil wars. It is but seldom that our -first thoughts are truly correct, and that is the case here; for -there are ten times more to dread from a patched up connexion than -from independance. I make the sufferers case my own, and I protest, -that were I driven from house and home, my property destroyed, and -my circumstances ruined, that as man, sensible of injuries, I could -never relish the doctrine of reconciliation, or consider myself -bound thereby. - -The colonies have manifested such a spirit of good order and -obedience to continental government, as is sufficient to make every -reasonable person easy and happy on that head. No man can assign the -least pretence for his fears, on any other grounds, than such as are -truly childish and ridiculous, viz. that one colony will be striving -for superiority over another. - -Where there are no distinctions there can be no superiority, perfect -equality affords no temptation. The republics of Europe are all (and -we may say always) in peace. Holland and Swisserland are without -wars, foreign or domestic: Monarchical governments, it is true, are -never long at rest; the crown itself is a temptation to enterprizing -ruffians at home; and that degree of pride and insolence ever -attendant on regal authority, swells into a rupture with foreign -powers, in instances, where a republican government, by being formed -on more natural principles, would negociate the mistake. - -If there is any true cause of fear respecting independance, it is -because no plan is yet laid down. Men do not see their way out-- -Wherefore, as an opening into that business, I offer the following -hints; at the same time modestly affirming, that I have no other -opinion of them myself, than that they may be the means of giving -rise to something better. Could the straggling thoughts of -individuals be collected, they would frequently form materials for -wise and able men to improve into useful matter. - -Let the assemblies be annual, with a President only. The -representation more equal. Their business wholly domestic, and -subject to the authority of a Continental Congress. - -Let each colony be divided into six, eight, or ten, convenient -districts, each district to send a proper number of delegates to -Congress, so that each colony send at least thirty. The whole number -in Congress will be at least 390. Each Congress to sit and to choose -a president by the following method. When the delegates are met, let -a colony be taken from the whole thirteen colonies by lot, after -which, let the whole Congress choose (by ballot) a president from -out of the delegates of that province. In the next Congress, let a -colony be taken by lot from twelve only, omitting that colony from -which the president was taken in the former Congress, and so -proceeding on till the whole thirteen shall have had their proper -rotation. And in order that nothing may pass into a law but what is -satisfactorily just, not less than three fifths of the Congress to -be called a majority.--He that will promote discord, under a -government so equally formed as this, wou \ No newline at end of file diff --git a/testdata/chunk05 b/testdata/chunk05 deleted file mode 100644 index 7178fbf..0000000 --- a/testdata/chunk05 +++ /dev/null @@ -1,142 +0,0 @@ -ld have joined Lucifer in -his revolt. - -But as there is a peculiar delicacy, from whom, or in what manner, -this business must first arise, and as it seems most agreeable and -consistent that it should come from some intermediate body between -the governed and the governors, that is, between the Congress and -the people, let a Continental Conference be held, in the following -manner, and for the following purpose. - -A committee of twenty-six members of Congress, viz. two for each -colony. Two members from each House of Assembly, or Provincial -Convention; and five representatives of the people at large, to be -chosen in the capital city or town of each province, for, and in -behalf of the whole province, by as many qualified voters as shall -think proper to attend from all parts of the province for that -purpose; or, if more convenient, the representatives may be chosen -in two or three of the most populous parts thereof. In this -conference, thus assembled, will be united, the two grand principles -of business, knowledge and power. The members of Congress, -Assemblies, or Conventions, by having had experience in national -concerns, will be able and useful counsellors, and the whole, being -impowered by the people, will have a truly legal authority. - -The conferring members being met, let their business be to frame a -Continental Charter, or Charter of the United Colonies; (answering -to what is called the Magna Charta of England) fixing the number and -manner of choosing members of Congress, members of Assembly, with -their date of sitting, and drawing the line of business and -jurisdiction between them: (Always remembering, that our strength is -continental, not provincial:) Securing freedom and property to all -men, and above all things, the free exercise of religion, according -to the dictates of conscience; with such other matter as is -necessary for a charter to contain. Immediately after which, the -said Conference to dissolve, and the bodies which shall be chosen -comformable to the said charter, to be the legislators and governors -of this continent for the time being: Whose peace and happiness, may -God preserve, Amen. - -Should any body of men be hereafter delegated for this or some -similar purpose, I offer them the following extracts from that wise -observer on governments Dragonetti. "The science" says he "of the -politician consists in fixing the true point of happiness and -freedom. Those men would deserve the gratitude of ages, who should -discover a mode of government that contained the greatest sum of -individual happiness, with the least national expense. - -Dragonetti on virtue and rewards." - -But where says some is the King of America? I'll tell you Friend, he -reigns above, and doth not make havoc of mankind like the Royal -Brute of Britain. Yet that we may not appear to be defective even in -earthly honors, let a day be solemnly set apart for proclaiming the -charter; let it be brought forth placed on the divine law, the word -of God; let a crown be placed thereon, by which the world may know, -that so far as we approve of monarchy, that in America the law is -king. For as in absolute governments the King is law, so in free -countries the law ought to be King; and there ought to be no other. -But lest any ill use should afterwards arise, let the crown at the -conclusion of the ceremony be demolished, and scattered among the -people whose right it is. - -A government of our own is our natural right: And when a man -seriously reflects on the precariousness of human affairs, he will -become convinced, that it is infinitely wiser and safer, to form a -constitution of our own in a cool deliberate manner, while we have -it in our power, than to trust such an interesting event to time and -chance. If we omit it now, some Massanello ¹ may hereafter arise, -who laying hold of popular disquietudes, may collect together the -desperate and the discontented, and by assuming to themselves the -powers of government, may sweep away the liberties of the continent -like a deluge. Should the government of America return again into -the hands of Britain, the tottering situation of things, will be a -temptation for some desperate adventurer to try his fortune; and in -such a case, what relief can Britain give? Ere she could hear the -news, the fatal business might be done; and ourselves suffering like -the wretched Britons under the oppression of the Conqueror. Ye that -oppose independance now, ye know not what ye do; ye are opening a -door to eternal tyranny, by keeping vacant the seat of government. -There are thousands, and tens of thousands, who would think it -glorious to expel from the continent, that barbarous and hellish -power, which hath stirred up the Indians and Negroes to destroy us, -the cruelty hath a double guilt, it is dealing brutally by us, and -treacherously by them. - -¹ Thomas Anello, otherwise Massanello, a fisherman of Naples, who -after spiriting up his countrymen in the public market place, -against the oppressions of the Spaniards, to whom the place was then -subject, prompted them to revolt, and in the space of a day became -king. - -To talk of friendship with those in whom our reason forbids us to -have faith, and our affections wounded through a thousand pores -instruct us to detest, is madness and folly. Every day wears out the -little remains of kindred between us and them, and can there be any -reason to hope, that as the relationship expires, the affection will -increase, or that we shall agree better, when we have ten times more -and greater concerns to quarrel over than ever? - -Ye that tell us of harmony and reconciliation, can ye restore to us -the time that is past? Can ye give to prostitution its former -innocence? Neither can ye reconcile Britain and America. The last -cord now is broken, the people of England are presenting addresses -against us. There are injuries which nature cannot forgive; she -would cease to be nature if she did. As well can the lover forgive -the ravisher of his mistress, as the continent forgive the murders -of Britain. The Almighty hath implanted in us these unextinguishable -feelings for good and wise purposes. They are the guardians of his -image in our hearts. They distinguish us from the herd of common -animals. The social compact would dissolve, and justice be -extirpated the earth, or have only a casual existence were we -callous to the touches of affection. The robber, and the murderer, -would often escape unpunished, did not the injuries which our -tempers sustain, provoke us into justice. - -O ye that love mankind! Ye that dare oppose, not only the tyranny, -but the tyrant, stand forth! Every spot of the old world is overrun -with oppression. Freedom hath been hunted round the globe. Asia, and -Africa, have long expelled her--Europe regards her like a stranger, -and England hath given her warning to depart. O! receive the -fugitive, and prepare in time an asylum for mankind. - - - -OF THE PRESENT ABILITY OF AMERICA, -WITH SOME MISCELLANEOUS REFLEXIONS. - -I have never met with a man, either in England or America, who hath -not confessed his opinion, that a separation between the countries, -would take place one time or other: And there is no instance, in -which we have shewn less judgment, than in endeavouring to describe, -what we call, the ripeness or fitness of the Continent for -independance. - -As all men allow the measure, and vary only in their opinion of the -time, let us, in order to remove mistakes, take a general survey of -things, and endeavour, if possible, to find out the very time. But -we need not go far, the inquiry ceases at once, for, the time hath -found us. The general concurrence, the glorious union of all things -prove the fact. - -It is not in numbers, but in \ No newline at end of file diff --git a/testdata/chunk06 b/testdata/chunk06 deleted file mode 100644 index ca4ae04..0000000 --- a/testdata/chunk06 +++ /dev/null @@ -1,397 +0,0 @@ - unity, that our great strength lies; -yet our present numbers are sufficient to repel the force of all the -world. The Continent hath, at this time, the largest body of armed -and disciplined men of any power under Heaven; and is just arrived -at that pitch of strength, in which no single colony is able to -support itself, and the whole, when united, can accomplish the -matter, and either more, or, less than this, might be fatal in its -effects. Our land force is already sufficient, and as to naval -affairs, we cannot be insensible, that Britain would never suffer an -American man of war to be built, while the continent remained in her -hands. Wherefore, we should be no forwarder an hundred years hence -in that branch, than we are now; but the truth is, we should be less -so, because the timber of the country is every day diminishing, and -that, which will remain at last, will be far off and difficult to -procure. - -Were the continent crowded with inhabitants, her sufferings under -the present circumstances would be intolerable. The more sea port -towns we had, the more should we have both to defend and to lose. -Our present numbers are so happily proportioned to our wants, that -no man need be idle. The diminution of trade affords an army, and -the necessities of an army create a new trade. - -Debts we have none; and whatever we may contract on this account -will serve as a glorious memento of our virtue. Can we but leave -posterity with a settled form of government, an independant -constitution of its own, the purchase at any price will be cheap. -But to expend millions for the sake of getting a few vile acts -repealed, and routing the present ministry only, is unworthy the -charge, and is using posterity with the utmost cruelty; because it -is leaving them the great work to do, and a debt upon their backs, -from which they derive no advantage. Such a thought is unworthy a -man of honor, and is the true characteristic of a narrow heart and a -pedling politician. - -The debt we may contract doth not deserve our regard if the work be -but accomplished. No nation ought to be without a debt. A national -debt is a national bond; and when it bears no interest, is in no -case a grievance. Britain is oppressed with a debt of upwards of one -hundred and forty millions sterling, for which she pays upwards of -four millions interest. And as a compensation for her debt, she has -a large navy; America is without a debt, and without a navy; yet for -the twentieth part of the English national debt, could have a navy -as large again. The navy of England is not worth, at this time, more -than three millions and an half sterling. - -The first and second editions of this pamphlet were published -without the following calculations, which are now given as a proof -that the above estimation of the navy is just. See Entic's naval -history, intro. page 56. - -The charge of building a ship of each rate, and furnishing her with -masts, yards, sails and rigging, together with a proportion of eight -months boatswain's and carpenter's sea-stores, as calculated by Mr. -Burchett, Secretary to the navy. - - £ - [pounds - sterling] -For a ship of 100 guns = 35,553 - 90 = 29,886 - 80 = 23,638 - 70 = 17,785 - 60 = 14,197 - 50 = 10,606 - 40 = 7,558 - 30 = 5,846 - 20 = 3,710 - -And from hence it is easy to sum up the value, or cost rather, of -the whole British navy, which in the year 1757, when it was at its -greatest glory consisted of the following ships and guns: - -Ships. Guns. Cost of one. Cost of all. - Cost in £ [pounds sterling] - 6 100 35,553 213,318 - 12 90 29,886 358,632 - 12 80 23,638 283,656 - 43 70 17,785 764,755 - 35 60 14,197 496,895 - 40 50 10,606 424,240 - 45 40 7,558 340,110 - 58 20 3,710 215,180 - 85 Sloops, bombs - and fireships, one - with another, at } 2,000 170,000 - ------------ -Cost 3,266,786 -Remains for Guns 233,214 - ------------ - 3,500,000 - -No country on the globe is so happily situated, or so internally -capable of raising a fleet as America. Tar, timber, iron, and -cordage are her natural produce. We need go abroad for nothing. -Whereas the Dutch, who make large profits by hiring out their ships -of war to the Spaniards and Portuguese, are obliged to import most -of the materials they use. We ought to view the building a fleet as -an article of commerce, it being the natural manufactory of this -country. It is the best money we can lay out. A navy when finished -is worth more than it cost. And is that nice point in national -policy, in which commerce and protection are united. Let us build; -if we want them not, we can sell; and by that means replace our -paper currency with ready gold and silver. - -In point of manning a fleet, people in general run into great errors; -it is not necessary that one fourth part should be sailors. The -Terrible privateer, Captain Death, stood the hottest engagement of -any ship last war, yet had not twenty sailors on board, though her -complement of men was upwards of two hundred. A few able and social -sailors will soon instruct a sufficient number of active landmen in -the common work of a ship. Wherefore, we never can be more capable -to begin on maritime matters than now, while our timber is standing, -our fisheries blocked up, and our sailors and shipwrights out of -employ. Men of war, of seventy and eighty guns were built forty -years ago in New-England, and why not the same now? Ship-building is -America's greatest pride, and in which, she will in time excel the -whole world. The great empires of the east are mostly inland, and -consequently excluded from the possibility of rivalling her. Africa -is in a state of barbarism; and no power in Europe, hath either such -an extent of coast, or such an internal supply of materials. Where -nature hath given the one, she has withheld the other; to America -only hath she been liberal of both. The vast empire of Russia is -almost shut out from the sea; wherefore, her boundless forests, her -tar, iron, and cordage are only articles of commerce. - -In point of safety, ought we to be without a fleet? We are not the -little people now, which we were sixty years ago; at that time we -might have trusted our property in the streets, or fields rather; -and slept securely without locks or bolts to our doors or windows. -The case now is altered, and our methods of defence, ought to -improve with our increase of property. A common pirate, twelve -months ago, might have come up the Delaware, and laid the city of -Philadelphia under instant contribution, for what sum he pleased; -and the same might have happened to other places. Nay, any daring -fellow, in a brig of fourteen or sixteen guns, might have robbed the -whole Continent, and carried off half a million of money. These are -circumstances which demand our attention, and point out the -necessity of naval protection. - -Some, perhaps, will say, that after we have made it up with Britain, -she will protect us. Can we be so unwise as to mean, that she shall -keep a navy in our harbours for that purpose? Common sense will tell -us, that the power which hath endeavoured to subdue us, is of all -others, the most improper to defend us. Conquest may be effected -under the pretence of friendship; and ourselves, after a long and -brave resistance, be at last cheated into slavery. And if her ships -are not to be admitted into our harbours, I would ask, how is she to -protect us? A navy three or four thousand miles off can be of little -use, and on sudden emergencies, none at all. Wherefore, if we must -hereafter protect ourselves, why not do it for ourselves? Why do it -for another? - -The English list of ships of war, is long and formidable, but not a -tenth part of them are at any one time fit for service, numbers of -them not in being; yet their names are pompously continued in the -list, if only a plank be left of the ship: and not a fifth part, of -such as are fit for service, can be spared on any one station at one -time. The East and West Indies, Mediterranean, Africa, and other -parts over which Britain extends her claim, make large demands upon -her navy. From a mixture of prejudice and inattention, we have -contracted a false notion respecting the navy of England, and have -talked as if we should have the whole of it to encounter at once, -and for that reason, supposed, that we must have one as large; which -not being instantly practicable, have been made use of by a set of -disguised Tories to discourage our beginning thereon. Nothing can be -farther from truth than this; for if America had only a twentieth -part of the naval force of Britain, she would be by far an over -match for her; because, as we neither have, nor claim any foreign -dominion, our whole force would be employed on our own coast, where -we should, in the long run, have two to one the advantage of those -who had three or four thousand miles to sail over, before they could -attack us, and the same distance to return in order to refit and -recruit. And although Britain by her fleet, hath a check over our -trade to Europe, we have as large a one over her trade to the West- -Indies, which, by laying in the neighbourhood of the Continent, is -entirely at its mercy. - -Some method might be fallen on to keep up a naval force in time of -peace, if we should not judge it necessary to support a constant -navy. If premiums were to be given to merchants, to build and employ -in their service ships mounted with twenty, thirty, forty or fifty -guns, (the premiums to be in proportion to the loss of bulk to the -merchants) fifty or sixty of those ships, with a few guardships on -constant duty, would keep up a sufficient navy, and that without -burdening ourselves with the evil so loudly complained of in England, -of suffering their fleet, in time of peace to lie rotting in the -docks. To unite the sinews of commerce and defense is sound policy; -for when our strength and our riches play into each other's hand, we -need fear no external enemy. - -In almost every article of defense we abound. Hemp flourishes even -to rankness, so that we need not want cordage. Our iron is superior -to that of other countries. Our small arms equal to any in the world. -Cannon we can cast at pleasure. Saltpetre and gunpowder we are every -day producing. Our knowledge is hourly improving. Resolution is our -inherent character, and courage hath never yet forsaken us. -Wherefore, what is it that we want? Why is it that we hesitate? From -Britain we can expect nothing but ruin. If she is once admitted to -the government of America again, this Continent will not be worth -living in. Jealousies will be always arising; insurrections will be -constantly happening; and who will go forth to quell them? Who will -venture his life to reduce his own countrymen to a foreign obedience? -The difference between Pennsylvania and Connecticut, respecting some -unlocated lands, shews the insignificance of a British government, -and fully proves, that nothing but Continental authority can -regulate Continental matters. - -Another reason why the present time is preferable to all others, is, -that the fewer our numbers are, the more land there is yet -unoccupied, which instead of being lavished by the king on his -worthless dependants, may be hereafter applied, not only to the -discharge of the present debt, but to the constant support of -government. No nation under heaven hath such an advantage as this. - -The infant state of the Colonies, as it is called, so far from being -against, is an argument in favour of independance. We are -sufficiently numerous, and were we more so, we might be less united. -It is a matter worthy of observation, that the more a country is -peopled, the smaller their armies are. In military numbers, the -ancients far exceeded the moderns: and the reason is evident. For -trade being the consequence of population, men become too much -absorbed thereby to attend to anything else. Commerce diminishes the -spirit, both of patriotism and military defence. And history -sufficiently informs us, that the bravest achievements were always -accomplished in the non-age of a nation. With the increase of -commerce, England hath lost its spirit. The city of London, -notwithstanding its numbers, submits to continued insults with the -patience of a coward. The more men have to lose, the less willing -are they to venture. The rich are in general slaves to fear, and -submit to courtly power with the trembling duplicity of a Spaniel. - -Youth is the seed time of good habits, as well in nations as in -individuals. It might be difficult, if not impossible, to form the -Continent into one government half a century hence. The vast variety -of interests, occasioned by an increase of trade and population, -would create confusion. Colony would be against colony. Each being -able might scorn each other's assistance: and while the proud and -foolish gloried in their little distinctions, the wise would lament, -that the union had not been formed before. Wherefore, the present -time is the true time for establishing it. The intimacy which is -contracted in infancy, and the friendship which is formed in -misfortune, are, of all others, the most lasting and unalterable. -Our present union is marked with both these characters: we are young -and we have been distressed; but our concord hath withstood our -troubles, and fixes a memorable area for posterity to glory in. - -The present time, likewise, is that peculiar time, which never -happens to a nation but once, viz. the time of forming itself into a -government. Most nations have let slip the opportunity, and by that -means have been compelled to receive laws from their conquerors, -instead of making laws for themselves. First, they had a king, and -then a form of government; whereas, the articles or charter of -government, should be formed first, and men delegated to execute -them afterward: but from the errors of other nations, let us learn -wisdom, and lay hold of the present opportunity--To begin government -at the right end. - -When William the Conqueror subdued England, he gave them law at the -point of the sword; and until we consent, that the seat of -government, in America, be legally and authoritatively occupied, we -shall be in danger of having it filled by some fortunate ruffian, -who may treat us in the same manner, and then, where will be our -freedom? where our property? - -As to religion, I hold it to be the indispensable duty of all -government, to protect all conscientious professors thereof, and I -know of no other business which government hath to do therewith. Let -a man throw aside that narrowness of soul, that selfishness of -principle, which the niggards of all professions are so unwilling to -part with, and he will be at once delivered of his fears on that head. -Suspicion is the companion of mean souls, and the bane of all good -society. For myself, I fully and conscientiously believe, that it is -the will of the Almighty, that there should be diversity of -religious opinions among us: It affords a larger field for our -Christian kindness. Were we all of one way of thinking, our -religious dispositions would want matter for probation; and on this -liberal principle, I look on the various denominations among us, to -be like children of the same family, differing only, in what is -called, their Christian names. - -In page forty, I threw out a few thoughts on the propriety of a -Continental Charter, (for I only presume to offer hints, not plans) -and in this place, I take the liberty of re-mentioning the subject, -by observing, that a charter is to be understood as a bond of solemn -obligation, which the whole enters into, to support the right of -every separate part, whether of religion, personal freedom, or -property. A firm bargain and a right reckoning make long friends. - -In a former page I likewise mentioned the necessity of a large and -equal representation; and there is no political matter which more -deserves our attention. A small number of electors, or a small -number of representatives, are equally dangerous. But if the number -of the representatives be not only small, but unequal, the danger is -increased. As an instance of this, I mention the following; when the -Associators petition was before the House of Assembly of -Pennsylvania; twenty-eight members only were present, all the Bucks -county members, being eight, voted against it, and had seven of the -Chester members done the same, this whole province had been governed -by two counties only, and this danger it is always exposed to. The -unwarrantable stretch likewise, which that house made in their last -sitting, to gain an undue authority over the delegates of that -province, ought to warn the people at large, how they trust power -out of their own hands. A set of instructions for the Delegates were -put together, which in point of sense and business would have -dishonoured a schoolboy, and after being approved by a few, a very -few without doors, were carried into the House, and there passed in -behalf of the whole colony; whereas, did the whole colony know, with -what ill-will that House hath entered on some necessary public -measures, they would not hesitate a moment to think them unworthy of -such a trust. - -Immediate necessity makes many things convenient, which if continued -would grow into oppressions. Expedience and right are different -things. When the calamities of America required a consultation, -there was no method so ready, or at that time so proper, as to -appoint persons from the several Houses of Assembly for that purpose; -and the wisdom with which they have proceeded hath preserved this -continent from ruin. But as it is more than probable that we shall -never be without a Congress, every well wisher to good order, must -own, that the mode for choosing members of that body, deserves -consideration. And I put it as a question to those, who make a study -of mankind, whether representation and election is not too great a -power for one and the same body of men to possess? When we are -planning for posterity, we ought to remember, that virtue is not -hereditary. - -It is from our enemies that we often gain excellent maxims, and are -frequently surprised into reason by their mistakes. Mr. Cornwall -(one of the Lords of the Treasury) treated the petition of the New- -York Assembly with contempt, because that House, he said, consisted -but of twenty-six members, which trifling number, he argued, could -not with decency be put for the whole. We thank him for his -involuntary honesty. ¹ - -¹ Those who would fully understand of what great consequence a large -and equal representation is to a state, should read Burgh's -political disquisitions. - -To Conclude, however strange it may appear to some, or however -unwilling they may be to think so, matters not, but many strong and -striking reasons may be given, to shew, that nothing can settle our -affairs so expeditiously as an open and determined declaration for -independance. Some of which are, - -First.--It is the custom of nations, when any two are at war, for -some other powers, not engaged in the quarrel, to step in as -mediators, and bring about the preliminaries of a peace: but while -America calls herself the Subject of Great-Britain, no power, -however well disposed she may be, can offer her mediation. Wherefore, -in our present state we may quarrel on for ever. - -Secondly.--It is unreasonable to suppose, that France or Spain will -give us any kind of assistance, if we mean only, to make use of that -assistance for the purpose of repairing the breach, and -strengthening the connection between Britain and America; because, -those powers would be sufferers by the consequences. - -Thirdly.--While we profess ourselves the subjects of Britain, we -must, in the eye of foreign nations, be considered as rebels. The -precedent is somewhat dangerous to their peace, for men to be in -arms under the name of subjects; we, on the spot, can solve the -paradox: but to unite resistance and subjection, requires an idea -much too refined for common understanding. - -Fourthly.--Were a manifesto to be published, and despatched to -foreign courts, setting forth the miseries we have endured, and the -peaceable methods we have ineffectually used for redress; declaring, -at the same time, that not being able, any longer, to live happily -or safely under the cruel disposition of the British court, we had -been driven to the necessity of breaking off all connections with -her; at the same time, assuring all such courts of our peaceable -disposition towards them, and of our desire of entering into trade -with them: Such a memorial would produce more good effects to this -Continent, than if a ship were freighted with petitions to Britain. - -Under our present denomination of British subjects, we can neither -be received nor heard abroad: The custom of all courts is against us, -and will be so, until, by an independance, we take rank with other -nations. - -These proceedings may at first appear strange and difficult; but, -like all other steps which we have already passed over, will in a -little time become familiar and agreeable; and, until an -independance is declared, the Continent will feel itself like a man -who continues putting off some unpleasant business from day to day, -yet knows it must be done, hates to set about it, wishes it over, -and is continually haunted with the thoughts of its necessity. - - - -APPENDIX. - -Since the publication of the first edition of this pamphlet, or -rather, on the same day on which it came out, the King's Speech made -its appearance in this city. Had the spirit of prophecy directed the -birth of this production, it cou \ No newline at end of file diff --git a/testdata/chunk07 b/testdata/chunk07 deleted file mode 100644 index 7ba9e48..0000000 --- a/testdata/chunk07 +++ /dev/null @@ -1,22 +0,0 @@ -ld not have brought it forth, at a -more seasonable juncture, or a more necessary time. The bloody -mindedness of the one, shew the necessity of pursuing the doctrine -of the other. Men read by way of revenge. And the Speech, instead of -terrifying, prepared a way for the manly principles of Independance. - -Ceremony, and even, silence, from whatever motive they may arise, -have a hurtful tendency, when they give the least degree of -countenance to base and wicked performances; wherefore, if this -maxim be admitted, it naturally follows, that the King's Speech, as -being a piece of finished villainy, deserved, and still deserves, a -general execration both by the Congress and the people. Yet, as the -domestic tranquillity of a nation, depends greatly, on the chastity -of what may properly be called national manners, it is often better, -to pass some things over in silent disdain, than to make use of such -new methods of dislike, as might introduce the least innovation, on -that guardian of our peace and safety. And, perhaps, it is chiefly -owing to this prudent delicacy, that the King's Speech, hath not, -before now, suffered a public execution. The Speech if it may be -called one, is nothing better than a wilful audacious libel against -the truth, the common good, and the existence of mankind; and is a -formal and pompous method of offering up human sacrifices to \ No newline at end of file diff --git a/testdata/chunk08 b/testdata/chunk08 deleted file mode 100644 index f98d00a..0000000 --- a/testdata/chunk08 +++ /dev/null @@ -1,16 +0,0 @@ - the -pride of tyrants. But this general massacre of mankind, is one of -the privileges, and the certain consequence of Kings; for as nature -knows them not, they know not her, and although they are beings of -our own creating, they know not us, and are become the gods of their -creators. The Speech hath one good quality, which is, that it is not -calculated to deceive, neither can we, even if we would, be deceived -by it. Brutality and tyranny appear on the face of it. It leaves us -at no loss: And every line convinces, even in the moment of reading, -that He, who hunts the woods for prey, the naked and untutored -Indian, is less a Savage than the King of Britain. - -Sir John Dalrymple, the putative father of a whining jesuitical -piece, fallaciously called, "The Address of the people of England to -the inhabitants of America," hath, perhaps, from a vain supposition, -that the people here were to be fr \ No newline at end of file diff --git a/testdata/chunk09 b/testdata/chunk09 deleted file mode 100644 index 52848ae..0000000 --- a/testdata/chunk09 +++ /dev/null @@ -1,121 +0,0 @@ -ightened at the pomp and -description of a king, given, (though very unwisely on his part) the -real character of the present one: "But" says this writer, "if you -are inclined to pay compliments to an administration, which we do -not complain of," (meaning the Marquis of Rockingham's at the repeal -of the Stamp Act) "it is very unfair in you to withhold them from -that prince, by whose nod alone they were permitted to do any -thing." This is toryism with a witness! Here is idolatry even -without a mask: And he who can calmly hear, and digest such doctrine, -hath forfeited his claim to rationality--an apostate from the order -of manhood; and ought to be considered--as one, who hath not only -given up the proper dignity of man, but sunk himself beneath the -rank of animals, and contemptibly crawls through the world like a -worm. - -However, it matters very little now, what the king of England either -says or does; he hath wickedly broken through every moral and human -obligation, trampled nature and conscience beneath his feet; and by -a steady and constitutional spirit of insolence and cruelty, -procured for himself an universal hatred. It is now the interest of -America to provide for herself. She hath already a large and young -family, whom it is more her duty to take care of, than to be -granting away her property, to support a power who is become a -reproach to the names of men and christians--Ye, whose office it is -to watch over the morals of a nation, of whatsoever sect or -denomination ye are of, as well as ye, who are more immediately the -guardians of the public liberty, if ye wish to preserve your native -country uncontaminated by European corruption, ye must in secret -wish a separation--But leaving the moral part to private reflection, -I shall chiefly confine my farther remarks to the following heads. - -First. That it is the interest of America to be separated from -Britain. - -Secondly. Which is the easiest and most practicable plan, -reconciliation or independance? with some occasional remarks. - -In support of the first, I could, if I judged it proper, produce the -opinion of some of the ablest and most experienced men on this -continent; and whose sentiments, on that head, are not yet publicly -known. It is in reality a self-evident position: For no nation in a -state of foreign dependance, limited in its commerce, and cramped -and fettered in its legislative powers, can ever arrive at any -material eminence. America doth not yet know what opulence is; and -although the progress which she hath made stands unparalleled in the -history of other nations, it is but childhood, compared with what -she would be capable of arriving at, had she, as she ought to have, -the legislative powers in her own hands. England is, at this time, -proudly coveting what would do her no good, were she to accomplish -it; and the Continent hesitating on a matter, which will be her -final ruin if neglected. It is the commerce and not the conquest of -America, by which England is to be benefited, and that would in a -great measure continue, were the countries as independant of each -other as France and Spain; because in many articles, neither can go -to a better market. But it is the independance of this country of -Britain or any other, which is now the main and only object worthy -of contention, and which, like all other truths discovered by -necessity, will appear clearer and stronger every day. - -First. Because it will come to that one time or other. - -Secondly. Because, the longer it is delayed the harder it will be to -accomplish. - -I have frequently amused myself both in public and private companies, -with silently remarking, the specious errors of those who speak -without reflecting. And among the many which I have heard, the -following seems the most general, viz. that had this rupture -happened forty or fifty years hence, instead of now, the Continent -would have been more able to have shaken off the dependance. To -which I reply, that our military ability, at this time, arises from -the experience gained in the last war, and which in forty or fifty -years time, would have been totally extinct. The Continent, would -not, by that time, have had a General, or even a military officer -left; and we, or those who may succeed us, would have been as -ignorant of martial matters as the ancient Indians: And this single -position, closely attended to, will unanswerably prove, that the -present time is preferable to all others. The argument turns thus-- -at the conclusion of the last war, we had experience, but wanted -numbers; and forty or fifty years hence, we should have numbers, -without experience; wherefore, the proper point of time, must be -some particular point between the two extremes, in which a -sufficiency of the former remains, and a proper increase of the -latter is obtained: And that point of time is the present time. - -The reader will pardon this digression, as it does not properly come -under the head I first set out with, and to which I again return by -the following position, viz. - -Should affairs be patched up with Britain, and she to remain the -governing and sovereign power of America, (which, as matters are now -circumstanced, is giving up the point intirely) we shall deprive -ourselves of the very means of sinking the debt we have, or may -contract. The value of the back lands which some of the provinces -are clandestinely deprived of, by the unjust extention of the limits -of Canada, valued only at five pounds sterling per hundred acres, -amount to upwards of twenty-five millions, Pennsylvania currency; -and the quit-rents at one penny sterling per acre, to two millions -yearly. - -It is by the sale of those lands that the debt may be sunk, without -burthen to any, and the quit-rent reserved thereon, will always -lessen, and in time, will wholly support the yearly expence of -government. It matters not how long the debt is in paying, so that -the lands when sold be applied to the discharge of it, and for the -execution of which, the Congress for the time being, will be the -continental trustees. - -I proceed now to the second head, viz. Which is the easiest and most -practicable plan, reconciliation or independance; with some -occasional remarks. - -He who takes nature for his guide is not easily beaten out of his -argument, and on that ground, I answer generally--That independance -being a single simple line, contained within ourselves; and -reconciliation, a matter exceedingly perplexed and complicated, and -in which, a treacherous capricious court is to interfere, gives the -answer without a doubt. - -The present state of America is truly alarming to every man who is -capable of reflexion. Without law, without government, \ No newline at end of file diff --git a/testdata/chunk10 b/testdata/chunk10 deleted file mode 100644 index c7cb957..0000000 --- a/testdata/chunk10 +++ /dev/null @@ -1,10 +0,0 @@ -without any -other mode of power than what is founded on, and granted by courtesy. -Held together by an unexampled concurrence of sentiment, which is -nevertheless subject to change, and which every secret enemy is -endeavouring to dissolve. Our present condition, is, Legislation -without law; wisdom without a plan; constitution without a name; and, -what is strangely astonishing, perfect Independance contending for -dependance. The instance is without a precedent; the case never -existed before; and who can tell what may be the event? The property -o \ No newline at end of file diff --git a/testdata/chunk11 b/testdata/chunk11 deleted file mode 100644 index d56e9bb..0000000 --- a/testdata/chunk11 +++ /dev/null @@ -1,6 +0,0 @@ -f no man is secure in the present unbraced system of things. The -mind of the multitude is left at random, and seeing no fixed object -before them, they pursue such as fancy or opinion starts. Nothing is -criminal; there is no such thing as treason; wherefore, every one -thinks himself at liberty to act as he pleases. The Tories dared not -have assembled offe \ No newline at end of file diff --git a/testdata/chunk12 b/testdata/chunk12 deleted file mode 100644 index 64f5171..0000000 --- a/testdata/chunk12 +++ /dev/null @@ -1,123 +0,0 @@ -nsively, had they known that their lives, by that -act, were forfeited to the laws of the state. A line of distinction -should be drawn, between, English soldiers taken in battle, and -inhabitants of America taken in arms. The first are prisoners, but -the latter traitors. The one forfeits his liberty, the other his -head. - -Notwithstanding our wisdom, there is a visible feebleness in some of -our proceedings which gives encouragement to dissensions. The -Continental Belt is too loosely buckled. And if something is not -done in time, it will be too late to do any thing, and we shall fall -into a state, in which, neither Reconciliation nor Independance will -be practicable. The king and his worthless adherents are got at -their old game of dividing the Continent, and there are not wanting -among us, Printers, who will be busy in spreading specious -falsehoods. The artful and hypocritical letter which appeared a few -months ago in two of the New-York papers, and likewise in two others, -is an evidence that there are men who want either judgment or -honesty. - -It is easy getting into holes and corners and talking of -reconciliation: But do such men seriously consider, how difficult -the task is, and how dangerous it may prove, should the Continent -divide thereon. Do they take within their view, all the various -orders of men whose situation and circumstances, as well as their -own, are to be considered therein. Do they put themselves in the -place of the sufferer whose all is already gone, and of the soldier, -who hath quitted all for the defence of his country. If their ill -judged moderation be suited to their own private situations only, -regardless of others, the event will convince them, that "they are -reckoning without their Host." - -Put us, say some, on the footing we were on in sixty-three: To which -I answer, the request is not now in the power of Britain to comply -with, neither will she propose it; but if it were, and even should -be granted, I ask, as a reasonable question, By what means is such a -corrupt and faithless court to be kept to its engagements? Another -parliament, nay, even the present, may hereafter repeal the -obligation, on the pretence, of its being violently obtained, or -unwisely granted; and in that case, Where is our redress?--No going -to law with nations; cannon are the barristers of Crowns; and the -sword, not of justice, but of war, decides the suit. To be on the -footing of sixty-three, it is not sufficient, that the laws only be -put on the same state, but, that our circumstances, likewise, be put -on the same state; Our burnt and destroyed towns repaired or built -up, our private losses made good, our public debts (contracted for -defence) discharged; otherwise, we shall be millions worse than we -were at that enviable period. Such a request, had it been complied -with a year ago, would have won the heart and soul of the Continent- --but now it is too late, "The Rubicon is passed." - -Besides, the taking up arms, merely to enforce the repeal of a -pecuniary law, seems as unwarrantable by the divine law, and as -repugnant to human feelings, as the taking up arms to enforce -obedience thereto. The object, on either side, doth not justify the -means; for the lives of men are too valuable to be cast away on such -trifles. It is the violence which is done and threatened to our -persons; the destruction of our property by an armed force; the -invasion of our country by fire and sword, which conscientiously -qualifies the use of arms: And the instant, in which such a mode of -defence became necessary, all subjection to Britain ought to have -ceased; and the independancy of America, should have been considered, -as dating its æra from, and published by, the first musket that was -fired against her. This line is a line of consistency; neither drawn -by caprice, nor extended by ambition; but produced by a chain of -events, of which the colonies were not the authors. - -I shall conclude these remarks, with the following timely and well -intended hints. We ought to reflect, that there are three different -ways, by which an independancy may hereafter be effected; and that -one of those three, will one day or other, be the fate of America, -viz. By the legal voice of the people in Congress; by a military -power; or by a mob: It may not always happen that our soldiers are -citizens, and the multitude a body of reasonable men; virtue, as I -have already remarked, is not hereditary, neither is it perpetual. -Should an independancy be brought about by the first of those means, -we have every opportunity and every encouragement before us, to form -the noblest purest constitution on the face of the earth. We have it -in our power to begin the world over again. A situation, similar to -the present, hath not happened since the days of Noah until now. The -birthday of a new world is at hand, and a race of men, perhaps as -numerous as all Europe contains, are to receive their portion of -freedom from the event of a few months. The Reflexion is awful--and -in this point of view, How trifling, how ridiculous, do the little, -paltry cavellings, of a few weak or interested men appear, when -weighed against the business of a world. - -Should we neglect the present favorable and inviting period, and an -Independance be hereafter effected by any other means, we must -charge the consequence to ourselves, or to those rather, whose -narrow and prejudiced souls, are habitually opposing the measure, -without either inquiring or reflecting. There are reasons to be -given in support of Independance, which men should rather privately -think of, than be publicly told of. We ought not now to be debating -whether we shall be independant or not, but, anxious to accomplish -it on a firm, secure, and honorable basis, and uneasy rather that it -is not yet began upon. Every day convinces us of its necessity. Even -the Tories (if such beings yet remain among us) should, of all men, -be the most solicitous to promote it; for, as the appointment of -committees at first, protected them from popular rage, so, a wise -and well established form of government, will be the only certain -means of continuing it securely to them. Wherefore, if they have not -virtue enough to be Whigs, they ought to have prudence enough to -wish for Independance. - -In short, Independance is the only Bond that can tye and keep us -together. We shall then see our object, and our ears will be legally -shut against the schemes of an intriguing, as well, as a cruel enemy. -We shall then too, be on a proper footing, to treat with Britain; -for there is reason to conclude, that the pride of that court, will -be less hurt by treating with the American states for terms of peace, -than with those, whom she denominates, "rebellious subjects," for -terms of accommodation. It is our delaying it that encourages her to -hope for conquest, and our backwardness tends only to prolong the -war. As we have, without any good effect therefrom, withheld our -trade to obtain a redress of our grievances, let us now try the -alternative, by independantly redressing them ourselves, and then -offering to open the trade. The mercantile and reasonable part in -England, will be still with us; because, peace with trade, is -preferable to war without it. And if this offer be not accepted, -other courts may be applied to. - -On these g \ No newline at end of file diff --git a/testdata/chunk13 b/testdata/chunk13 deleted file mode 100644 index 483cd2b..0000000 --- a/testdata/chunk13 +++ /dev/null @@ -1,44 +0,0 @@ -rounds I rest the matter. And as no offer hath yet been -made to refute the doctrine contained in the former editions of this -pamphlet, it is a negative proof, that either the doctrine cannot be -refuted, or, that the party in favour of it are too numerous to be -opposed. Wherefore, instead of gazing at each other with suspicious -or doubtful curiosity; let each of us, hold out to his neighbour the -hearty hand of friendship, and unite in drawing a line, which, like -an act of oblivion shall bury in forgetfulness every former -dissension. Let the names of Whig and Tory be extinct; and let none -other be heard among us, than those of a good citizen, an open and -resolute friend, and a virtuous supporter of the rights of mankind -and of the FREE AND INDEPENDANT STATES OF AMERICA. - -To the Representatives of the Religious Society of the People called -Quakers, or to so many of them as were concerned in publishing the -late piece, entitled "The Ancient Testimony and Principles of the -People called Quakers renewed, with Respect to the King and -Government, and touching the Commotions now prevailing in these and -other parts of America addressed to the People in General." - -The Writer of this, is one of those few, who never dishonours -religion either by ridiculing, or cavilling at any denomination -whatsoever. To God, and not to man, are all men accountable on the -score of religion. Wherefore, this epistle is not so properly -addressed to you as a religious, but as a political body, dabbling -in matters, which the professed Quietude of your Principles instruct -you not to meddle with. - -As you have, without a proper authority for so doing, put yourselves -in the place of the whole body of the Quakers, so, the writer of -this, in order to be on an equal rank with yourselves, is under the -necessity, of putting himself in the place of all those, who, -approve the very writings and principles, against which your -testimony is directed: And he hath chosen this singular situation, -in order, that you might discover in him that presumption of -character which you cannot see in yourselves. For neither he nor you -can have any claim or title to Political Representation. - -When men have departed from the right way, it is no wonder that they -stumble and fall. And it is evident from the manner in which ye have -managed your testimony, that politics, (as a religious body of men) -is not your proper Walk; for however well adapted it might appear to -you, it is, nevertheless, a jumble of good and bad put unwisely -togeth \ No newline at end of file diff --git a/testdata/chunk14 b/testdata/chunk14 deleted file mode 100644 index 5f66307..0000000 --- a/testdata/chunk14 +++ /dev/null @@ -1,314 +0,0 @@ -er, and the conclusion drawn therefrom, both unnatural and -unjust. - -The two first pages, (and the whole doth not make four) we give you -credit for, and expect the same civility from you, because the love -and desire of peace is not confined to Quakerism, it is the natural, -as well the religious wish of all denominations of men. And on this -ground, as men labouring to establish an Independant Constitution of -our own, do we exceed all others in our hope, end, and aim. Our plan -is peace for ever. We are tired of contention with Britain, and can -see no real end to it but in a final separation. We act consistently, -because for the sake of introducing an endless and uninterrupted -peace, do we bear the evils and burthens of the present day. We are -endeavoring, and will steadily continue to endeavour, to separate -and dissolve a connexion which hath already filled our land with -blood; and which, while the name of it remains, will be the fatal -cause of future mischiefs to both countries. - -We fight neither for revenge nor conquest; neither from pride nor -passion; we are not insulting the world with our fleets and armies, -nor ravaging the globe for plunder. Beneath the shade of our own -vines are we attacked; in our own houses, and on our own lands, is -the violence committed against us. We view our enemies in the -character of Highwaymen and Housebreakers, and having no defence for -ourselves in the civil law, are obliged to punish them by the -military one, and apply the sword, in the very case, where you have -before now, applied the halter--Perhaps we feel for the ruined and -insulted sufferers in all and every part of the continent, with a -degree of tenderness which hath not yet made its way into some of -your bosoms. But be ye sure that ye mistake not the cause and ground -of your Testimony. Call not coldness of soul, religion; nor put the -Bigot in the place of the Christian. - -O ye partial ministers of your own acknowledged principles. If the -bearing arms be sinful, the first going to war must be more so, by -all the difference between wilful attack and unavoidable defence. -Wherefore, if ye really preach from conscience, and mean not to make -a political hobby-horse of your religion, convince the world thereof, -by proclaiming your doctrine to our enemies, for they likewise bear -arms. Give us proof of your sincerity by publishing it at St. -James's, to the commanders in chief at Boston, to the Admirals and -Captains who are piratically ravaging our coasts, and to all the -murdering miscreants who are acting in authority under him whom ye -profess to serve. Had ye the honest soul of Barclay ¹ ye would -preach repentance to your king; Ye would tell the Royal Wretch his -sins, and warn him of eternal ruin. Ye would not spend your partial -invectives against the injured and the insulted only, but, like -faithful ministers, would cry aloud and spare none. Say not that ye -are persecuted, neither endeavour to make us the authors of that -reproach, which, ye are bringing upon yourselves; for we testify -unto all men, that we do not complain against you because ye are -Quakers, but because ye pretend to be and are not Quakers. - -¹"Thou hast tasted of prosperity and adversity; thou knowest what it -is to be banished thy native country, to be over-ruled as well as to -rule, and set upon the throne; and being oppressed thou hast reason -to know how hateful the oppressor is both to God and man: If after -all these warnings and advertisements, thou dost not turn unto the -Lord with all thy heart, but forget him who remembered thee in thy -distress, and give up thyself to follow lust and vanity, surely -great will be thy condemnation.--Against which snare, as well as the -temptation of those who may or do feed thee, and prompt thee to evil, -the most excellent and prevalent remedy will be, to apply thyself to -that light of Christ which shineth in thy conscience, and which -neither can, nor will flatter thee, nor suffer thee to be at ease in -thy sins." - ---Barclay's address to Charles II. - -Alas! it seems by the particular tendency of some part of your -testimony, and other parts of your conduct, as if, all sin was -reduced to, and comprehended in, the act of bearing arms, and that -by the people only. Ye appear to us, to have mistaken party for -conscience; because, the general tenor of your actions wants -uniformity: And it is exceedingly difficult to us to give credit to -many of your pretended scruples; because, we see them made by the -same men, who, in the very instant that they are exclaiming against -the mammon of this world, are nevertheless, hunting after it with a -step as steady as Time, and an appetite as keen as Death. - -The quotation which ye have made from Proverbs, in the third page of -your testimony, that, "when a man's ways please the Lord, he maketh -even his enemies to be at peace with him"; is very unwisely chosen -on your part; because, it amounts to a proof, that the king's ways -(whom ye are desirous of supporting) do not please the Lord, -otherwise, his reign would be in peace. - -I now proceed to the latter part of your testimony, and that, for -which all the foregoing seems only an introduction, viz. - -"It hath ever been our judgment and principle, since we were called -to profess the light of Christ Jesus, manifested in our consciences -unto this day, that the setting up and putting down kings and -governments, is God's peculiar prerogative; for causes best known to -himself: And that it is not our business to have any hand or -contrivance therein; nor to be busy bodies above our station, much -less to plot and contrive the ruin, or overturn of any of them, but -to pray for the king, and safety of our nation, and good of all men: -That we may live a peaceable and quiet life, in all godliness and -honesty; under the government which God is pleased to set over us."- --If these are really your principles why do ye not abide by them? -Why do ye not leave that, which ye call God's Work, to be managed by -himself? These very principles instruct you to wait with patience -and humility, for the event of all public measures, and to receive -that event as the divine will towards you. Wherefore, what occasion -is there for your political testimony if you fully believe what it -contains: And the very publishing it proves, that either, ye do not -believe what ye profess, or have not virtue enough to practise what -ye believe. - -The principles of Quakerism have a direct tendency to make a man the -quiet and inoffensive subject of any, and every government which is -set over him. And if the setting up and putting down of kings and -governments is God's peculiar prerogative, he most certainly will -not be robbed thereof by us; wherefore, the principle itself leads -you to approve of every thing, which ever happened, or may happen to -kings as being his work. Oliver Cromwell thanks you. Charles, then, -died not by the hands of man; and should the present Proud Imitator -of him, come to the same untimely end, the writers and publishers of -the Testimony, are bound, by the doctrine it contains, to applaud -the fact. Kings are not taken away by miracles, neither are changes -in governments brought about by any other means than such as are -common and human; and such as we are now using. Even the dispersion -of the Jews, though foretold by our Saviour, was effected by arms. -Wherefore, as ye refuse to be the means on one side, ye ought not to -be meddlers on the other; but to wait the issue in silence; and -unless ye can produce divine authority, to prove, that the Almighty -who hath created and placed this new world, at the greatest distance -it could possibly stand, east and west, from every part of the old, -doth, nevertheless, disapprove of its being independant of the -corrupt and abandoned court of Britain, unless I say, ye can shew -this, how can ye on the ground of your principles, justify the -exciting and stirring up the people "firmly to unite in the -abhorrence of all such writings, and measures, as evidence a desire -and design to break off the happy connexion we have hitherto enjoyed, -with the kingdom of Great-Britain, and our just and necessary -subordination to the king, and those who are lawfully placed in -authority under him." What a slap of the face is here! the men, who -in the very paragraph before, have quietly and passively resigned up -the ordering, altering, and disposal of kings and governments, into -the hands of God, are now, recalling their principles, and putting -in for a share of the business. Is it possible, that the conclusion, -which is here justly quoted, can any ways follow from the doctrine -laid down? The inconsistency is too glaring not to be seen; the -absurdity too great not to be laughed at; and such as could only -have been made by those, whose understandings were darkened by the -narrow and crabby spirit of a despairing political party; for ye are -not to be considered as the whole body of the Quakers but only as a -factional and fractional part thereof. - -Here ends the examination of your testimony; (which I call upon no -man to abhor, as ye have done, but only to read and judge of fairly;) -to which I subjoin the following remark; "That the setting up and -putting down of kings," most certainly mean, the making him a king, -who is yet not so, and the making him no king who is already one. -And pray what hath this to do in the present case? We neither mean -to set up nor to put down, neither to make nor to unmake, but to -have nothing to do with them. Wherefore, your testimony in whatever -light it is viewed serves only to dishonor your judgement, and for -many other reasons had better have been let alone than published. - -First, Because it tends to the decrease and reproach of all religion -whatever, and is of the utmost danger to society, to make it a party -in political disputes. - -Secondly, Because it exhibits a body of men, numbers of whom disavow -the publishing political testimonies, as being concerned therein and -approvers thereof. - -Thirdly, Because it hath a tendency to undo that continental harmony -and friendship which yourselves by your late liberal and charitable -donations hath lent a hand to establish; and the preservation of -which is of the utmost consequence to us all. - -And here without anger or resentment I bid you farewell. Sincerely -wishing, that as men and christians, ye may always fully and -uninterruptedly enjoy every civil and religious right; and be, in -your turn, the means of securing it to others; but that the example -which ye have unwisely set, of mingling religion with politics, may -be disavowed and reprobated by every inhabitant of America. - - - -F I N I S. - - - - -On Common Sense - -"No writer has exceeded Paine in ease and familiarity of style, in -perspicuity of expression, happiness of elucidation, and in simple -and unassuming language." - -Thomas Jefferson - -"A pamphlet called 'Commonsense' makes a great noise. One of the -vilest things that ever was published to the world. Full of false -representations, lies, calumny, and treason, whose principles are to -subvert all Kingly Governments and erect an Independent Republic." - -Nicholas Cresswell - -"I dreaded the effect so popular a pamphlet might have among the -people, and determined to do all in my Power to counteract the -effect of it." - -John Adams - -"Its effects were sudden and extensive upon the American mind. It -was read by public men." - -Dr. Benjamin Rush - -"Have you read the pamphlet Common Sense? I never saw such a -masterful performance.... In short, I own myself convinced, by the -arguments, of the necessity of separation." - -General Charles Lee - - - - -Transcriber's Notes - -This production of the Bradford edition of Common Sense retains the -original characteristics of the document--the author's use of -capitalization (large and small), spelling, and italics. - -The page numbers of this version of the book were my invention, for -ease in reading the HTML document. The page numbers can more -accurately be called paragraph numbers. They match the paragraph -numbers in the edited text of 'Common Sense' from the National -Humanities Center. - -In one case, the text refers to page forty (see our Page 130). We -provided a link to the appropriate part of our document but retained -the page number specified by Paine. Our page numbers are not carried -over to the Kindle, E-PUB, and text documents produced by Project -Gutenberg. - -The section "On Common Sense," containing quotes about Common Sense, -have been added by this transcriber. - -*** END OF THIS PROJECT GUTENBERG EBOOK COMMON SENSE *** - -***** This file should be named 147-h.htm or 147-h.zip ***** - -This and all associated files of various formats will be found in: -http://www.gutenberg.org/1/4/147/ - -Updated editions will replace the previous one--the old editions -will be renamed. - -Creating the works from public domain print editions means that no -one owns a United States copyright in these works, so the Foundation -(and you!) can copy and distribute it in the United States without -permission and without paying copyright royalties. Special rules, -set forth in the General Terms of Use part of this license, apply to -copying and distributing Project Gutenberg™ electronic works to -protect the PROJECT GUTENBERG™ concept and trademark. Project -Gutenberg is a registered trademark, and may not be used if you -charge for the eBooks, unless you receive specific permission. If -you do not charge anything for copies of this eBook, complying with -the rules is very easy. You may use this eBook for nearly any -purpose such as creation of derivative works, reports, performances -and research. They may be modified and printed and given away--you -may do practically anything with public domain eBooks. -Redistribution is subject to the trademark license, especially -commercial redistribution. - -*** START: FULL LICENSE *** - -THE FULL PROJECT GUTENBERG LICENSE PLEASE READ THIS BEFORE YOU -DISTRIBUTE OR USE THIS WORK - -To protect the Project Gutenberg™ mission of promoting the free -distribution of electronic works, by using or distributing this work -(or any other work associated in any way with the phrase "Project -Gutenberg"), you agree to comply with all the terms of the Full -Project Gutenberg™ License (available with this file or online at -http://gutenberg.net/license). - -Section 1. General Terms of Use and Redistributing Project -Gutenberg™ electronic works - -1.A. By reading or using any part of this Project Gutenberg™ -electronic work, you indicate that you have read, understand, agree -to and accept all the terms of this license and intellectual -property (trademark/copyright) agreement. If you do not agree to -abide by all the terms of this agreement, you must cease using and -return or destroy all copies of Project Gutenberg™ electronic works -in your possession. If you paid a fee for obtaining a copy of or -access to a Project Gutenberg™ electronic work and you do not agree -to be bound by the terms of this agreement, you may obtain a refund -from the person or entity to whom you paid the fee as set forth in -paragraph 1.E.8. - -1.B. "Project Gutenberg" is a registered trademark. It may only be -used on or associated in any way with an electronic work by people -who agree to be bound by the terms of this agreement. There are a -few things that you can do with most Project Gutenberg™ electronic -works even without complying with the full terms of this agreement. -See paragraph 1.C below. There are a lot of things you can do with -Project Gutenberg™ electronic works if you follow the terms of this -agreement and help preserve free future access to Project Gutenberg™ -electronic works. See paragraph 1.E below. - -1.C. The Project Gutenberg Literary Archive Foundation ("the -Foundation" or PGLAF), owns a compilation copyright in the -collection of Project Gutenberg™ electronic works. Nearly all the -individual works in the collection are in the public domain in the -United States. If an individual work is in the public domain in the -United States and you are l \ No newline at end of file diff --git a/testdata/chunk15 b/testdata/chunk15 deleted file mode 100644 index 8a5b0a8..0000000 --- a/testdata/chunk15 +++ /dev/null @@ -1,248 +0,0 @@ -ocated in the United States, we do not -claim a right to prevent you from copying, distributing, performing, -displaying or creating derivative works based on the work as long as -all references to Project Gutenberg are removed. Of course, we hope -that you will support the Project Gutenberg™ mission of promoting -free access to electronic works by freely sharing Project Gutenberg™ -works in compliance with the terms of this agreement for keeping the -Project Gutenberg™ name associated with the work. You can easily -comply with the terms of this agreement by keeping this work in the -same format with its attached full Project Gutenberg™ License when -you share it without charge with others. - -1.D. The copyright laws of the place where you are located also -govern what you can do with this work. Copyright laws in most -countries are in a constant state of change. If you are outside the -United States, check the laws of your country in addition to the -terms of this agreement before downloading, copying, displaying, -performing, distributing or creating derivative works based on this -work or any other Project Gutenberg™ work. The Foundation makes no -representations concerning the copyright status of any work in any -country outside the United States. - -1.E. Unless you have removed all references to Project Gutenberg: - -1.E.1. The following sentence, with active links to, or other -immediate access to, the full Project Gutenberg™ License must appear -prominently whenever any copy of a Project Gutenberg™ work (any work -on which the phrase "Project Gutenberg" appears, or with which the -phrase "Project Gutenberg" is associated) is accessed, displayed, -performed, viewed, copied or distributed: - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net. - -1.E.2. If an individual Project Gutenberg™ electronic work is -derived from the public domain (does not contain a notice indicating -that it is posted with permission of the copyright holder), the work -can be copied and distributed to anyone in the United States without -paying any fees or charges. If you are redistributing or providing -access to a work with the phrase "Project Gutenberg" associated with -or appearing on the work, you must comply either with the -requirements of paragraphs 1.E.1 through 1.E.7 or obtain permission -for the use of the work and the Project Gutenberg™ trademark as set -forth in paragraphs 1.E.8 or 1.E.9. - -1.E.3. If an individual Project Gutenberg™ electronic work is posted -with the permission of the copyright holder, your use and -distribution must comply with both paragraphs 1.E.1 through 1.E.7 -and any additional terms imposed by the copyright holder. Additional -terms will be linked to the Project Gutenberg ™ License for all -works posted with the permission of the copyright holder found at -the beginning of this work. - -1.E.4. Do not unlink or detach or remove the full Project Gutenberg™ -License terms from this work, or any files containing a part of this -work or any other work associated with Project Gutenberg™. - -1.E.5. Do not copy, display, perform, distribute or redistribute -this electronic work, or any part of this electronic work, without -prominently displaying the sentence set forth in paragraph 1.E.1 -with active links or immediate access to the full terms of the -Project Gutenberg™ License. - -1.E.6. You may convert to and distribute this work in any binary, -compressed, marked up, nonproprietary or proprietary form, including -any word processing or hypertext form. However, if you provide -access to or distribute copies of a Project Gutenberg™ work in a -format other than "Plain Vanilla ASCII" or other format used in the -official version posted on the official Project Gutenberg™ web site -(www.gutenberg.net), you must, at no additional cost, fee or expense -to the user, provide a copy, a means of exporting a copy, or a means -of obtaining a copy upon request, of the work in its original "Plain -Vanilla ASCII" or other form. Any alternate format must include the -full Project Gutenberg™ License as specified in paragraph 1.E.1. - -1.E.7. Do not charge a fee for access to, viewing, displaying, -performing, copying or distributing any Project Gutenberg™ works -unless you comply with paragraph 1.E.8 or 1.E.9. - -1.E.8. You may charge a reasonable fee for copies of or providing -access to or distributing Project Gutenberg™ electronic works -provided that - -* You pay a royalty fee of 20% of the gross profits you derive from -the use of Project Gutenberg™ works calculated using the method you -already use to calculate your applicable taxes. The fee is owed to -the owner of the Project Gutenberg™ trademark, but he has agreed to -donate royalties under this paragraph to the Project Gutenberg -Literary Archive Foundation. Royalty payments must be paid within 60 -days following each date on which you prepare (or are legally -required to prepare) your periodic tax returns. Royalty payments -should be clearly marked as such and sent to the Project Gutenberg -Literary Archive Foundation at the address specified in Section 4, -"Information about donations to the Project Gutenberg Literary -Archive Foundation." - -* You provide a full refund of any money paid by a user who notifies -you in writing (or by e-mail) within 30 days of receipt that s/he -does not agree to the terms of the full Project Gutenberg™ License. -You must require such a user to return or destroy all copies of the -works possessed in a physical medium and discontinue all use of and -all access to other copies of Project Gutenberg ™ works. - -* You provide, in accordance with paragraph 1.F.3, a full refund of -any money paid for a work or a replacement copy, if a defect in the -electronic work is discovered and reported to you within 90 days of -receipt of the work. - -* You comply with all other terms of this agreement for free -distribution of Project Gutenberg™ works. - -1.E.9. If you wish to charge a fee or distribute a Project -Gutenberg™ electronic work or group of works on different terms than -are set forth in this agreement, you must obtain permission in -writing from both the Project Gutenberg Literary Archive Foundation -and Michael Hart, the owner of the Project Gutenberg™ trademark. -Contact the Foundation as set forth in Section 3 below. - -1.F. - -1.F.1. Project Gutenberg volunteers and employees expend -considerable effort to identify, do copyright research on, -transcribe and proofread public domain works in creating the Project -Gutenberg™ collection. Despite these efforts, Project Gutenberg™ -electronic works, and the medium on which they may be stored, may -contain "Defects," such as, but not limited to, incomplete, -inaccurate or corrupt data, transcription errors, a copyright or -other intellectual property infringement, a defective or damaged -disk or other medium, a computer virus, or computer codes that -damage or cannot be read by your equipment. - -1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES: Except for the -"Right of Replacement or Refund" described in paragraph 1.F.3, the -Project Gutenberg Literary Archive Foundation, the owner of the -Project Gutenberg™ trademark, and any other party distributing a -Project Gutenberg™ electronic work under this agreement, disclaim -all liability to you for damages, costs and expenses, including -legal fees. You agree that you have no remedies for negligence, -strict liability, breach of warranty or breach of contract except -those provided in Paragraph F3. You agree that the Foundation, the -trademark owner, and any distributor under this agreement will not -be liable to you for actual, direct, indirect, consequential, -punitive or incidental damages even if you give notice of the -possibility of such damage. - -1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND: If you discover a -defect in this electronic work within 90 days of receiving it, you -can receive a refund of the money (if any) you paid for it by -sending a written explanation to the person you received the work -from. If you received the work on a physical medium, you must return -the medium with your written explanation. The person or entity that -provided you with the defective work may elect to provide a -replacement copy in lieu of a refund. If you received the work -electronically, the person or entity providing it to you may choose -to give you a second opportunity to receive the work electronically -in lieu of a refund. If the second copy is also defective, you may -demand a refund in writing without further opportunities to fix the -problem. - -1.F.4. Except for the limited right of replacement or refund set -forth in paragraph 1.F.3, this work is provided to you 'AS-IS', with -no other warranties of any kind, express or implied, including but -not limited to warranties of merchantibility or fitness for any -purpose. - -1.F.5. Some states do not allow disclaimers of certain implied -warranties or the exclusion or limitation of certain types of -damages. If any disclaimer or limitation set forth in this agreement -violates the law of the state applicable to this agreement, the -agreement shall be interpreted to make the maximum disclaimer or -limitation permitted by the applicable state law. The invalidity or -unenforceability of any provision of this agreement shall not void -the remaining provisions. - -1.F.6. INDEMNITY: You agree to indemnify and hold the Foundation, -the trademark owner, any agent or employee of the Foundation, anyone -providing copies of Project Gutenberg™ electronic works in -accordance with this agreement, and any volunteers associated with -the production, promotion and distribution of Project Gutenberg™ -electronic works, harmless from all liability, costs and expenses, -including legal fees, that arise directly or indirectly from any of -the following which you do or cause to occur: (a) distribution of -this or any Project Gutenberg™ work, (b) alteration, modification, -or additions or deletions to any Project Gutenberg™ work, and (c) -any Defect you cause. - -Section 2. Information about the Mission of Project Gutenberg™ - -Project Gutenberg ™ is synonymous with the free distribution of -electronic works in formats readable by the widest variety of -computers including obsolete, old, middle-aged and new computers. It -exists because of the efforts of hundreds of volunteers and -donations from people in all walks of life. - -Volunteers and financial support to provide volunteers with the -assistance they need, is critical to reaching Project Gutenberg's™ -goals and ensuring that the Project Gutenberg™ collection will -remain freely available for generations to come. In 2001, the -Project Gutenberg Literary Archive Foundation was created to provide -a secure and permanent future for Project Gutenberg™ and future -generations. To learn more about the Project Gutenberg Literary -Archive Foundation and how your efforts and donations can help, see -Sections 3 and 4 and the Foundation web page at http://www.pglaf.org. - -Section 3. Information about the Project Gutenberg Literary Archive -Foundation - -The Project Gutenberg Literary Archive Foundation is a non profit -501(c)(3) educational corporation organized under the laws of the -state of Mississippi and granted tax exempt status by the Internal -Revenue Service. The Foundation's EIN or federal tax identification -number is 64-6221541. Its 501(c)(3) letter is posted at -http://pglaf.org/fundraising. Contributions to the Project Gutenberg -Literary Archive Foundation are tax deductible to the full extent -permitted by U.S. federal laws and your state's laws. - -The Foundation's principal office is located at 4557 Melan Dr. S. -Fairbanks, AK, 99712., but its volunteers and employees are -scattered throughout numerous locations. Its business office is -located at 809 North 1500 West, Salt Lake City, UT 84116, (801) 596- -1887, email business@pglaf.org. Email contact links and up to date -contact information can be found at the Foundation's web site and -official page at http://pglaf.org. - -For additional contact information: - -Dr. Gregory B. Newby -Chief Executive and Director -gbnewby@pglaf.org - -Section 4. Information about Donations to the Project Gutenberg -Literary Archive Foundation - -Project Gutenberg™ depends upon and cannot survive without wide -spread public support and donations to carry out its mission of -increasing the number of public domain and licensed works that can -be freely distributed in machine readable form accessible by the -widest array of equipment including outdated equipment. Many small -donations ($1 to $5,000) are particularly important to maintaining -tax exempt status with the IRS. - -The Foundation is committed to complying with the laws regulating -charities and charitable donations in all 50 states of the United -States. Compliance requirements are not uniform and it takes a -considerable effort, much paperwork and many fees to meet and keep -up with these requirements. We do not solic \ No newline at end of file diff --git a/testdata/chunk16 b/testdata/chunk16 deleted file mode 100644 index 3232511..0000000 --- a/testdata/chunk16 +++ /dev/null @@ -1,43 +0,0 @@ -it donations in locations -where we have not received written confirmation of compliance. To -send donations or determine the status of compliance for any -particular state visit http://pglaf.org. - -While we cannot and do not solicit contributions from states where -we have not met the solicitation requirements, we know of no -prohibition against accepting unsolicited donations from donors in -such states who approach us with offers to donate. - -International donations are gratefully accepted, but we cannot make -any statements concerning tax treatment of donations received from -outside the United States. U.S. laws alone swamp our small staff. - -Please check the Project Gutenberg Web pages for current donation -methods and addresses. Donations are accepted in a number of other -ways including including checks, online payments and credit card -donations. To donate, please visit: http://pglaf.org/donate. - -Section 5. General Information About Project Gutenberg™ electronic -works. - -Professor Michael S. Hart is the originator of the Project -Gutenberg™ concept of a library of electronic works that could be -freely shared with anyone. For thirty years, he produced and -distributed Project Gutenberg™ eBooks with only a loose network of -volunteer support. - -Project Gutenberg™ eBooks are often created from several printed -editions, all of which are confirmed as Public Domain in the U.S. -unless a copyright notice is included. Thus, we do not necessarily -keep eBooks in compliance with any particular paper edition. - -Most people start at our Web site which has the main PG search -facility: - -http://www.gutenberg.net - -This Web site includes information about Project Gutenberg™, -including how to make donations to the Project Gutenberg Literary -Archive Foundation, how to help produce our new eBooks, and how to -subscribe to our email newsletter to hear about new eBooks. - diff --git a/testdata/commonsense.txt b/testdata/commonsense similarity index 100% rename from testdata/commonsense.txt rename to testdata/commonsense diff --git a/testdata/empty b/testdata/empty new file mode 100644 index 0000000..e69de29 diff --git a/testdata/one b/testdata/one new file mode 100644 index 0000000..c1b0730 --- /dev/null +++ b/testdata/one @@ -0,0 +1 @@ +x \ No newline at end of file diff --git a/testdata/short b/testdata/short new file mode 100644 index 0000000..af5626b --- /dev/null +++ b/testdata/short @@ -0,0 +1 @@ +Hello, world! diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split12-max2500-split b/testdata/snapshots/TestSplitAndTree-commonsense-split12-max2500-split new file mode 100644 index 0000000..8888e1b --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split12-max2500-split @@ -0,0 +1,80 @@ +([]int) (len=78) { + (int) 1864, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 153, + (int) 1321, + (int) 2500, + (int) 611, + (int) 1922, + (int) 901, + (int) 808, + (int) 2500, + (int) 2500, + (int) 404, + (int) 2500, + (int) 140, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 1811, + (int) 2197, + (int) 2500, + (int) 2500, + (int) 1169, + (int) 2500, + (int) 2151, + (int) 251, + (int) 2500, + (int) 2500, + (int) 2204, + (int) 394, + (int) 1820, + (int) 321, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 827, + (int) 1276, + (int) 1832, + (int) 2500, + (int) 1946, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 1801, + (int) 1849, + (int) 2124, + (int) 2500, + (int) 843, + (int) 2500, + (int) 2500, + (int) 965, + (int) 2500, + (int) 2500, + (int) 722, + (int) 570, + (int) 2500, + (int) 1472, + (int) 2500, + (int) 2500, + (int) 2399, + (int) 2111, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 524, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 1070, + (int) 2500, + (int) 2355, + (int) 2500, + (int) 2151, + (int) 185, + (int) 2500, + (int) 670 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split12-max2500-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split12-max2500-tree new file mode 100644 index 0000000..c80a6a1 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split12-max2500-tree @@ -0,0 +1,505 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 21120, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 7653, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 9517, + Size: (uint64) 4432, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 13949, + Size: (uint64) 9035, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=6) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=7) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=5) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 97431, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 7204, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 57907, + Size: (uint64) 2214, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 60121, + Size: (uint64) 9924, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=6) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 13274, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 9301, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 85624, + Size: (uint64) 1849, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 87473, + Size: (uint64) 2124, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 16229, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 5965, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 98905, + Size: (uint64) 10264, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=6) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 38965, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 7399, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 116568, + Size: (uint64) 23560, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=11) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 140128, + Size: (uint64) 4651, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 144779, + Size: (uint64) 185, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 144964, + Size: (uint64) 3170, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-max2500-split b/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-max2500-split new file mode 100644 index 0000000..3603a0a --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-max2500-split @@ -0,0 +1,74 @@ +([]int) (len=72) { + (int) 1864, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 1474, + (int) 2500, + (int) 611, + (int) 1922, + (int) 901, + (int) 808, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 544, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 1811, + (int) 2197, + (int) 2500, + (int) 2500, + (int) 1169, + (int) 2500, + (int) 2151, + (int) 2500, + (int) 2500, + (int) 2455, + (int) 2214, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 1148, + (int) 1276, + (int) 1832, + (int) 2500, + (int) 1946, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 1801, + (int) 1849, + (int) 2124, + (int) 2500, + (int) 843, + (int) 2500, + (int) 2500, + (int) 965, + (int) 2500, + (int) 2500, + (int) 722, + (int) 570, + (int) 2500, + (int) 1472, + (int) 2500, + (int) 2500, + (int) 2399, + (int) 2111, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 524, + (int) 2500, + (int) 2500, + (int) 2500, + (int) 1070, + (int) 2500, + (int) 2355, + (int) 2500, + (int) 2151, + (int) 2500, + (int) 855 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-max2500-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-max2500-tree new file mode 100644 index 0000000..a322433 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-max2500-tree @@ -0,0 +1,429 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 35571, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 12085, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=6) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 13949, + Size: (uint64) 23486, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=12) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=5) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 19593, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 19593, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 7455, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 57907, + Size: (uint64) 2214, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 60121, + Size: (uint64) 9924, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=5) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 13274, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 9301, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 85624, + Size: (uint64) 1849, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 87473, + Size: (uint64) 2124, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 16229, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 5965, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 98905, + Size: (uint64) 10264, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=6) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 38965, + Children: ([]*hashsplit.TreeNode) (len=4) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 7399, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 116568, + Size: (uint64) 23560, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=11) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 140128, + Size: (uint64) 4651, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 144779, + Size: (uint64) 3355, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-split b/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-split new file mode 100644 index 0000000..d30c360 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-split @@ -0,0 +1,38 @@ +([]int) (len=36) { + (int) 1864, + (int) 7653, + (int) 1321, + (int) 3111, + (int) 1922, + (int) 901, + (int) 808, + (int) 2550, + (int) 2854, + (int) 2640, + (int) 11811, + (int) 2197, + (int) 6169, + (int) 4651, + (int) 7455, + (int) 2214, + (int) 8648, + (int) 1276, + (int) 1832, + (int) 4446, + (int) 7509, + (int) 1792, + (int) 1849, + (int) 2124, + (int) 3343, + (int) 5965, + (int) 5722, + (int) 570, + (int) 3972, + (int) 7399, + (int) 2111, + (int) 8024, + (int) 8570, + (int) 4855, + (int) 4651, + (int) 3355 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-tree new file mode 100644 index 0000000..cf6cff9 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split12-min512-tree @@ -0,0 +1,428 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 21120, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 7653, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 9517, + Size: (uint64) 4432, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 13949, + Size: (uint64) 9035, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=5) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 19593, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 19593, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 7455, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 57907, + Size: (uint64) 2214, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 60121, + Size: (uint64) 9924, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 13274, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 9301, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 85624, + Size: (uint64) 1849, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 87473, + Size: (uint64) 2124, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 16229, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 5965, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 98905, + Size: (uint64) 10264, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 38965, + Children: ([]*hashsplit.TreeNode) (len=4) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 7399, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 116568, + Size: (uint64) 23560, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 140128, + Size: (uint64) 4651, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 144779, + Size: (uint64) 3355, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split12-split b/testdata/snapshots/TestSplitAndTree-commonsense-split12-split new file mode 100644 index 0000000..cffdc61 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split12-split @@ -0,0 +1,42 @@ +([]int) (len=40) { + (int) 1864, + (int) 7653, + (int) 1321, + (int) 3111, + (int) 1922, + (int) 901, + (int) 808, + (int) 2550, + (int) 2854, + (int) 2640, + (int) 11811, + (int) 2197, + (int) 6169, + (int) 4651, + (int) 251, + (int) 7204, + (int) 394, + (int) 1820, + (int) 321, + (int) 8327, + (int) 1276, + (int) 1832, + (int) 4446, + (int) 7509, + (int) 1792, + (int) 1849, + (int) 2124, + (int) 3343, + (int) 5965, + (int) 5722, + (int) 570, + (int) 3972, + (int) 7399, + (int) 2111, + (int) 8024, + (int) 8570, + (int) 4855, + (int) 4651, + (int) 185, + (int) 3170 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split12-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split12-tree new file mode 100644 index 0000000..8640efa --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split12-tree @@ -0,0 +1,467 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 21120, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 7653, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 9517, + Size: (uint64) 4432, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 13949, + Size: (uint64) 9035, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=5) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 97431, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 7204, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 57907, + Size: (uint64) 2214, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 60121, + Size: (uint64) 9924, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 13274, + Children: ([]*hashsplit.TreeNode) (len=3) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 9301, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 85624, + Size: (uint64) 1849, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 87473, + Size: (uint64) 2124, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 16229, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 5965, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 98905, + Size: (uint64) 10264, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 38965, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 7399, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 116568, + Size: (uint64) 23560, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 140128, + Size: (uint64) 4651, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 144779, + Size: (uint64) 185, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 144964, + Size: (uint64) 3170, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split13-max5000-split b/testdata/snapshots/TestSplitAndTree-commonsense-split13-max5000-split new file mode 100644 index 0000000..2b85cce --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split13-max5000-split @@ -0,0 +1,44 @@ +([]int) (len=42) { + (int) 1864, + (int) 5000, + (int) 2653, + (int) 4432, + (int) 5000, + (int) 1182, + (int) 2853, + (int) 5000, + (int) 5000, + (int) 4451, + (int) 2197, + (int) 5000, + (int) 5000, + (int) 820, + (int) 251, + (int) 5000, + (int) 2204, + (int) 2214, + (int) 5000, + (int) 4924, + (int) 1832, + (int) 4446, + (int) 5000, + (int) 4301, + (int) 1849, + (int) 2124, + (int) 3343, + (int) 5000, + (int) 965, + (int) 5000, + (int) 5000, + (int) 264, + (int) 5000, + (int) 2399, + (int) 5000, + (int) 5000, + (int) 5000, + (int) 5000, + (int) 3560, + (int) 4651, + (int) 185, + (int) 3170 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split13-max5000-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split13-max5000-tree new file mode 100644 index 0000000..51c164a --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split13-max5000-tree @@ -0,0 +1,301 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 21120, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=6) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 97431, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=5) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 13274, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 16229, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=5) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 38965, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=10) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-max5000-split b/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-max5000-split new file mode 100644 index 0000000..21ea175 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-max5000-split @@ -0,0 +1,41 @@ +([]int) (len=39) { + (int) 1864, + (int) 5000, + (int) 2653, + (int) 4432, + (int) 5000, + (int) 1182, + (int) 2853, + (int) 5000, + (int) 5000, + (int) 4451, + (int) 2197, + (int) 5000, + (int) 5000, + (int) 1071, + (int) 5000, + (int) 2204, + (int) 2214, + (int) 5000, + (int) 4924, + (int) 1832, + (int) 4446, + (int) 5000, + (int) 4301, + (int) 1849, + (int) 2124, + (int) 3343, + (int) 5000, + (int) 5000, + (int) 5000, + (int) 1229, + (int) 5000, + (int) 2399, + (int) 5000, + (int) 5000, + (int) 5000, + (int) 5000, + (int) 3560, + (int) 4651, + (int) 3355 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-max5000-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-max5000-tree new file mode 100644 index 0000000..b753fb3 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-max5000-tree @@ -0,0 +1,228 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 21120, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=6) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 110699, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13268, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13268, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 11071, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 97431, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=5) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 13274, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 16229, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 38965, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=9) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-split b/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-split new file mode 100644 index 0000000..53b9660 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-split @@ -0,0 +1,25 @@ +([]int) (len=23) { + (int) 1864, + (int) 7653, + (int) 4432, + (int) 6182, + (int) 2853, + (int) 14451, + (int) 2197, + (int) 10820, + (int) 7455, + (int) 2214, + (int) 9924, + (int) 1832, + (int) 4446, + (int) 9301, + (int) 1849, + (int) 2124, + (int) 3343, + (int) 5965, + (int) 10264, + (int) 7399, + (int) 23560, + (int) 4651, + (int) 3355 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-tree new file mode 100644 index 0000000..304aacf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split13-min1024-tree @@ -0,0 +1,261 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 21120, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 19593, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 19593, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 13274, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 16229, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 38965, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split13-split b/testdata/snapshots/TestSplitAndTree-commonsense-split13-split new file mode 100644 index 0000000..3943c0a --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split13-split @@ -0,0 +1,27 @@ +([]int) (len=25) { + (int) 1864, + (int) 7653, + (int) 4432, + (int) 6182, + (int) 2853, + (int) 14451, + (int) 2197, + (int) 10820, + (int) 251, + (int) 7204, + (int) 2214, + (int) 9924, + (int) 1832, + (int) 4446, + (int) 9301, + (int) 1849, + (int) 2124, + (int) 3343, + (int) 5965, + (int) 10264, + (int) 7399, + (int) 23560, + (int) 4651, + (int) 185, + (int) 3170 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split13-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split13-tree new file mode 100644 index 0000000..2eb207c --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split13-tree @@ -0,0 +1,284 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1864, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 1864, + Size: (uint64) 21120, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 2197, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 39632, + Size: (uint64) 10820, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 97431, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 4446, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 76323, + Size: (uint64) 13274, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 16229, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 109169, + Size: (uint64) 38965, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=5) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split14-max10000-split b/testdata/snapshots/TestSplitAndTree-commonsense-split14-max10000-split new file mode 100644 index 0000000..c9cea79 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split14-max10000-split @@ -0,0 +1,25 @@ +([]int) (len=23) { + (int) 1864, + (int) 10000, + (int) 10000, + (int) 1120, + (int) 10000, + (int) 4451, + (int) 2197, + (int) 10000, + (int) 820, + (int) 251, + (int) 10000, + (int) 9342, + (int) 1832, + (int) 4446, + (int) 10000, + (int) 3274, + (int) 3343, + (int) 10000, + (int) 6229, + (int) 10000, + (int) 10000, + (int) 10000, + (int) 8965 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split14-max10000-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split14-max10000-tree new file mode 100644 index 0000000..e581423 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split14-max10000-tree @@ -0,0 +1,191 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=4) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 97431, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=6) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-max10000-split b/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-max10000-split new file mode 100644 index 0000000..415bda0 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-max10000-split @@ -0,0 +1,22 @@ +([]int) (len=20) { + (int) 10000, + (int) 10000, + (int) 2984, + (int) 10000, + (int) 4451, + (int) 2197, + (int) 10000, + (int) 10000, + (int) 10000, + (int) 2245, + (int) 4446, + (int) 10000, + (int) 3274, + (int) 3343, + (int) 10000, + (int) 6229, + (int) 10000, + (int) 10000, + (int) 10000, + (int) 8965 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-max10000-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-max10000-tree new file mode 100644 index 0000000..0ddefe5 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-max10000-tree @@ -0,0 +1,104 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 110699, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 110699, + Children: ([]*hashsplit.TreeNode) (len=4) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 34442, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=5) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=3) { + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=6) { + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-split b/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-split new file mode 100644 index 0000000..501373d --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-split @@ -0,0 +1,12 @@ +([]int) (len=10) { + (int) 22984, + (int) 14451, + (int) 2197, + (int) 10820, + (int) 19593, + (int) 6278, + (int) 13274, + (int) 3343, + (int) 16229, + (int) 38965 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-tree new file mode 100644 index 0000000..cfd772e --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split14-min2048-tree @@ -0,0 +1,157 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=4) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 19593, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 19552, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split14-split b/testdata/snapshots/TestSplitAndTree-commonsense-split14-split new file mode 100644 index 0000000..b647d7b --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split14-split @@ -0,0 +1,15 @@ +([]int) (len=13) { + (int) 1864, + (int) 21120, + (int) 14451, + (int) 2197, + (int) 10820, + (int) 251, + (int) 19342, + (int) 1832, + (int) 4446, + (int) 13274, + (int) 3343, + (int) 16229, + (int) 38965 +} diff --git a/testdata/snapshots/TestSplitAndTree-commonsense-split14-tree b/testdata/snapshots/TestSplitAndTree-commonsense-split14-tree new file mode 100644 index 0000000..9bf5e8f --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-commonsense-split14-tree @@ -0,0 +1,181 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 148134, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 50452, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 37435, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 22984, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 22984, + Size: (uint64) 14451, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 37435, + Size: (uint64) 13017, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 97682, + Children: ([]*hashsplit.TreeNode) (len=2) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) (len=1) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50452, + Size: (uint64) 251, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 97431, + Children: ([]*hashsplit.TreeNode) (len=5) { + (*hashsplit.TreeNode)({ + Offset: (uint64) 50703, + Size: (uint64) 19342, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 70045, + Size: (uint64) 1832, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 71877, + Size: (uint64) 17720, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 89597, + Size: (uint64) 3343, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } + }), + (*hashsplit.TreeNode)({ + Offset: (uint64) 92940, + Size: (uint64) 55194, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=2) { + ([]uint8) , + ([]uint8) + } + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) + }) + }, + Chunks: ([][]uint8) +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split12-max2500-split b/testdata/snapshots/TestSplitAndTree-one-split12-max2500-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split12-max2500-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split12-max2500-tree b/testdata/snapshots/TestSplitAndTree-one-split12-max2500-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split12-max2500-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split12-min512-max2500-split b/testdata/snapshots/TestSplitAndTree-one-split12-min512-max2500-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split12-min512-max2500-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split12-min512-max2500-tree b/testdata/snapshots/TestSplitAndTree-one-split12-min512-max2500-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split12-min512-max2500-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split12-min512-split b/testdata/snapshots/TestSplitAndTree-one-split12-min512-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split12-min512-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split12-min512-tree b/testdata/snapshots/TestSplitAndTree-one-split12-min512-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split12-min512-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split12-split b/testdata/snapshots/TestSplitAndTree-one-split12-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split12-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split12-tree b/testdata/snapshots/TestSplitAndTree-one-split12-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split12-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split13-max5000-split b/testdata/snapshots/TestSplitAndTree-one-split13-max5000-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split13-max5000-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split13-max5000-tree b/testdata/snapshots/TestSplitAndTree-one-split13-max5000-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split13-max5000-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split13-min1024-max5000-split b/testdata/snapshots/TestSplitAndTree-one-split13-min1024-max5000-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split13-min1024-max5000-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split13-min1024-max5000-tree b/testdata/snapshots/TestSplitAndTree-one-split13-min1024-max5000-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split13-min1024-max5000-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split13-min1024-split b/testdata/snapshots/TestSplitAndTree-one-split13-min1024-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split13-min1024-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split13-min1024-tree b/testdata/snapshots/TestSplitAndTree-one-split13-min1024-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split13-min1024-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split13-split b/testdata/snapshots/TestSplitAndTree-one-split13-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split13-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split13-tree b/testdata/snapshots/TestSplitAndTree-one-split13-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split13-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split14-max10000-split b/testdata/snapshots/TestSplitAndTree-one-split14-max10000-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split14-max10000-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split14-max10000-tree b/testdata/snapshots/TestSplitAndTree-one-split14-max10000-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split14-max10000-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split14-min2048-max10000-split b/testdata/snapshots/TestSplitAndTree-one-split14-min2048-max10000-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split14-min2048-max10000-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split14-min2048-max10000-tree b/testdata/snapshots/TestSplitAndTree-one-split14-min2048-max10000-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split14-min2048-max10000-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split14-min2048-split b/testdata/snapshots/TestSplitAndTree-one-split14-min2048-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split14-min2048-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split14-min2048-tree b/testdata/snapshots/TestSplitAndTree-one-split14-min2048-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split14-min2048-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-one-split14-split b/testdata/snapshots/TestSplitAndTree-one-split14-split new file mode 100644 index 0000000..4e825a6 --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split14-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 1 +} diff --git a/testdata/snapshots/TestSplitAndTree-one-split14-tree b/testdata/snapshots/TestSplitAndTree-one-split14-tree new file mode 100644 index 0000000..3825edf --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-one-split14-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 1, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split12-max2500-split b/testdata/snapshots/TestSplitAndTree-short-split12-max2500-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split12-max2500-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split12-max2500-tree b/testdata/snapshots/TestSplitAndTree-short-split12-max2500-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split12-max2500-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split12-min512-max2500-split b/testdata/snapshots/TestSplitAndTree-short-split12-min512-max2500-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split12-min512-max2500-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split12-min512-max2500-tree b/testdata/snapshots/TestSplitAndTree-short-split12-min512-max2500-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split12-min512-max2500-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split12-min512-split b/testdata/snapshots/TestSplitAndTree-short-split12-min512-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split12-min512-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split12-min512-tree b/testdata/snapshots/TestSplitAndTree-short-split12-min512-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split12-min512-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split12-split b/testdata/snapshots/TestSplitAndTree-short-split12-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split12-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split12-tree b/testdata/snapshots/TestSplitAndTree-short-split12-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split12-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split13-max5000-split b/testdata/snapshots/TestSplitAndTree-short-split13-max5000-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split13-max5000-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split13-max5000-tree b/testdata/snapshots/TestSplitAndTree-short-split13-max5000-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split13-max5000-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split13-min1024-max5000-split b/testdata/snapshots/TestSplitAndTree-short-split13-min1024-max5000-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split13-min1024-max5000-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split13-min1024-max5000-tree b/testdata/snapshots/TestSplitAndTree-short-split13-min1024-max5000-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split13-min1024-max5000-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split13-min1024-split b/testdata/snapshots/TestSplitAndTree-short-split13-min1024-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split13-min1024-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split13-min1024-tree b/testdata/snapshots/TestSplitAndTree-short-split13-min1024-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split13-min1024-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split13-split b/testdata/snapshots/TestSplitAndTree-short-split13-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split13-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split13-tree b/testdata/snapshots/TestSplitAndTree-short-split13-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split13-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split14-max10000-split b/testdata/snapshots/TestSplitAndTree-short-split14-max10000-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split14-max10000-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split14-max10000-tree b/testdata/snapshots/TestSplitAndTree-short-split14-max10000-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split14-max10000-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split14-min2048-max10000-split b/testdata/snapshots/TestSplitAndTree-short-split14-min2048-max10000-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split14-min2048-max10000-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split14-min2048-max10000-tree b/testdata/snapshots/TestSplitAndTree-short-split14-min2048-max10000-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split14-min2048-max10000-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split14-min2048-split b/testdata/snapshots/TestSplitAndTree-short-split14-min2048-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split14-min2048-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split14-min2048-tree b/testdata/snapshots/TestSplitAndTree-short-split14-min2048-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split14-min2048-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +}) diff --git a/testdata/snapshots/TestSplitAndTree-short-split14-split b/testdata/snapshots/TestSplitAndTree-short-split14-split new file mode 100644 index 0000000..29bd4ad --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split14-split @@ -0,0 +1,3 @@ +([]int) (len=1) { + (int) 14 +} diff --git a/testdata/snapshots/TestSplitAndTree-short-split14-tree b/testdata/snapshots/TestSplitAndTree-short-split14-tree new file mode 100644 index 0000000..4fd94ba --- /dev/null +++ b/testdata/snapshots/TestSplitAndTree-short-split14-tree @@ -0,0 +1,8 @@ +(*hashsplit.TreeNode)({ + Offset: (uint64) 0, + Size: (uint64) 14, + Children: ([]*hashsplit.TreeNode) , + Chunks: ([][]uint8) (len=1) { + ([]uint8) + } +})