mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-29 07:07:16 +00:00
save
This commit is contained in:
parent
be8c96bbef
commit
377bc94675
@ -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()
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package compress
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/ledgerwatch/erigon-lib/mmap"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user