forked from RoaringBitmap/roaring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smat_generate_test.go
56 lines (51 loc) · 1.14 KB
/
smat_generate_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//go:build gofuzz
// +build gofuzz
package roaring
import (
"fmt"
"io/ioutil"
"os"
"testing"
"github.com/mschoch/smat"
)
func TestGenerateSmatCorpus(t *testing.T) {
for i, actionSeq := range smatActionSeqs {
byteSequence, err := actionSeq.ByteEncoding(&smatContext{},
smat.ActionID('S'), smat.ActionID('T'), smatActionMap)
if err != nil {
t.Fatalf("error from ByteEncoding, err: %v, i: %d, actonSeq: %#v",
err, i, actionSeq)
}
os.MkdirAll("workdir/corpus", 0700)
ioutil.WriteFile(fmt.Sprintf("workdir/corpus/%d", i), byteSequence, 0600)
}
}
var smatActionSeqs = []smat.ActionSeq{
{
smat.ActionID('X'),
smat.ActionID('X'),
smat.ActionID('Y'),
smat.ActionID('Y'),
smat.ActionID('<'),
smat.ActionID('<'),
smat.ActionID('*'),
smat.ActionID('x'),
smat.ActionID('y'),
smat.ActionID('*'),
smat.ActionID('['),
smat.ActionID('['),
smat.ActionID('B'),
smat.ActionID('a'),
smat.ActionID('o'),
smat.ActionID('A'),
smat.ActionID('O'),
smat.ActionID('#'),
smat.ActionID('X'),
smat.ActionID('Y'),
smat.ActionID('B'),
smat.ActionID('e'),
smat.ActionID('f'),
smat.ActionID('-'),
smat.ActionID('e'),
},
}