mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-01 00:31:21 +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) {
|
func TestCompressDict1(t *testing.T) {
|
||||||
tmpDir := t.TempDir()
|
tmpDir := t.TempDir()
|
||||||
file := path.Join(tmpDir, "compressed")
|
file := path.Join(tmpDir, t.Name())
|
||||||
t.Name()
|
t.Name()
|
||||||
c, err := NewCompressor(t.Name(), file, tmpDir, 1)
|
c, err := NewCompressor(t.Name(), file, tmpDir, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -81,7 +81,16 @@ func TestCompressDict1(t *testing.T) {
|
|||||||
if string(word) != expected {
|
if string(word) != expected {
|
||||||
t.Errorf("expected %s, got (hex) %x", expected, word)
|
t.Errorf("expected %s, got (hex) %x", expected, word)
|
||||||
}
|
}
|
||||||
|
|
||||||
i++
|
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()
|
defer d.Close()
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ package compress
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon-lib/mmap"
|
"github.com/ledgerwatch/erigon-lib/mmap"
|
||||||
|
@ -35,6 +35,10 @@ func FuzzRecSplit(f *testing.F) {
|
|||||||
if len(in) < count {
|
if len(in) < count {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
|
for len(in) < 1_000 {
|
||||||
|
in = append(in, in...)
|
||||||
|
}
|
||||||
|
|
||||||
// split in into count keys
|
// split in into count keys
|
||||||
dups := make(map[string]struct{})
|
dups := make(map[string]struct{})
|
||||||
// Length of one key
|
// Length of one key
|
||||||
|
Loading…
Reference in New Issue
Block a user