mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-23 08:30:07 -03:00
test: don't export tokenizer fixtures
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
This commit is contained in:
parent
6c7b91cb91
commit
7e136bade8
@ -91,7 +91,7 @@ var (
|
||||
"-", "|", "+", "&&", "<", "<", "-", "!", "!", "!", "=", "=", "!", ":", "=", ":", "=", ",", ",", "=", ">", ">", "=", "=", "=", "=", ">",
|
||||
"'", ",", ">", "=", ">", "=", "=", ">", "=", ">", ":", ">", "=", ">"}
|
||||
|
||||
Tests = []struct {
|
||||
tests = []struct {
|
||||
name string
|
||||
content []byte
|
||||
expected []string
|
||||
@ -101,7 +101,7 @@ var (
|
||||
)
|
||||
|
||||
func TestTokenize(t *testing.T) {
|
||||
for _, test := range Tests {
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
before := string(test.content)
|
||||
tokens := Tokenize(test.content)
|
||||
@ -118,7 +118,7 @@ func TestTokenize(t *testing.T) {
|
||||
func BenchmarkTokenizer_BaselineCopy(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for _, test := range Tests {
|
||||
for _, test := range tests {
|
||||
if len(test.content) > ByteLimit {
|
||||
test.content = test.content[:ByteLimit]
|
||||
}
|
||||
@ -130,7 +130,7 @@ func BenchmarkTokenizer_BaselineCopy(b *testing.B) {
|
||||
func BenchmarkTokenizer(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for _, test := range Tests {
|
||||
for _, test := range tests {
|
||||
Tokenize(test.content)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user