test: don't export tokenizer fixtures

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
This commit is contained in:
Alexander Bezzubov 2019-04-16 19:27:23 +02:00
parent 6c7b91cb91
commit 7e136bade8
No known key found for this signature in database
GPG Key ID: 8039F5787EFCD05D

View File

@ -91,7 +91,7 @@ var (
"-", "|", "+", "&&", "<", "<", "-", "!", "!", "!", "=", "=", "!", ":", "=", ":", "=", ",", ",", "=", ">", ">", "=", "=", "=", "=", ">", "-", "|", "+", "&&", "<", "<", "-", "!", "!", "!", "=", "=", "!", ":", "=", ":", "=", ",", ",", "=", ">", ">", "=", "=", "=", "=", ">",
"'", ",", ">", "=", ">", "=", "=", ">", "=", ">", ":", ">", "=", ">"} "'", ",", ">", "=", ">", "=", "=", ">", "=", ">", ":", ">", "=", ">"}
Tests = []struct { tests = []struct {
name string name string
content []byte content []byte
expected []string expected []string
@ -101,7 +101,7 @@ var (
) )
func TestTokenize(t *testing.T) { func TestTokenize(t *testing.T) {
for _, test := range Tests { for _, test := range tests {
t.Run(test.name, func(t *testing.T) { t.Run(test.name, func(t *testing.T) {
before := string(test.content) before := string(test.content)
tokens := Tokenize(test.content) tokens := Tokenize(test.content)
@ -118,7 +118,7 @@ func TestTokenize(t *testing.T) {
func BenchmarkTokenizer_BaselineCopy(b *testing.B) { func BenchmarkTokenizer_BaselineCopy(b *testing.B) {
b.ReportAllocs() b.ReportAllocs()
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
for _, test := range Tests { for _, test := range tests {
if len(test.content) > ByteLimit { if len(test.content) > ByteLimit {
test.content = test.content[:ByteLimit] test.content = test.content[:ByteLimit]
} }
@ -130,7 +130,7 @@ func BenchmarkTokenizer_BaselineCopy(b *testing.B) {
func BenchmarkTokenizer(b *testing.B) { func BenchmarkTokenizer(b *testing.B) {
b.ReportAllocs() b.ReportAllocs()
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
for _, test := range Tests { for _, test := range tests {
Tokenize(test.content) Tokenize(test.content)
} }
} }