This commit is contained in:
alex.sharov 2021-11-08 07:59:18 +07:00
parent be8c96bbef
commit 377bc94675
3 changed files with 15 additions and 1 deletions

View File

@ -55,7 +55,7 @@ func TestCompressEmptyDict(t *testing.T) {
func TestCompressDict1(t *testing.T) {
tmpDir := t.TempDir()
file := path.Join(tmpDir, "compressed")
file := path.Join(tmpDir, t.Name())
t.Name()
c, err := NewCompressor(t.Name(), file, tmpDir, 1)
if err != nil {
@ -81,7 +81,16 @@ func TestCompressDict1(t *testing.T) {
if string(word) != expected {
t.Errorf("expected %s, got (hex) %x", expected, word)
}
i++
}
g.Reset(0)
word, a := g.Current(nil)
fmt.Printf("a:%d\n", a)
expected := fmt.Sprintf("longlongword %d", 0)
if string(word) != expected {
t.Errorf("expected %s, got (hex) %x", expected, word)
}
defer d.Close()
}

View File

@ -18,6 +18,7 @@ package compress
import (
"encoding/binary"
"fmt"
"os"
"github.com/ledgerwatch/erigon-lib/mmap"

View File

@ -35,6 +35,10 @@ func FuzzRecSplit(f *testing.F) {
if len(in) < count {
t.Skip()
}
for len(in) < 1_000 {
in = append(in, in...)
}
// split in into count keys
dups := make(map[string]struct{})
// Length of one key