Reduced token size
This commit is contained in:
parent
7bfd0e731d
commit
1e3705df55
47 changed files with 543 additions and 764 deletions
|
@ -8,9 +8,10 @@ import (
|
|||
)
|
||||
|
||||
func TestCount(t *testing.T) {
|
||||
tokens := token.Tokenize([]byte(`a b b c c c`))
|
||||
assert.Equal(t, token.Count(tokens, token.Identifier, "a"), 1)
|
||||
assert.Equal(t, token.Count(tokens, token.Identifier, "b"), 2)
|
||||
assert.Equal(t, token.Count(tokens, token.Identifier, "c"), 3)
|
||||
assert.Equal(t, token.Count(tokens, token.Identifier, "d"), 0)
|
||||
buffer := []byte(`a b b c c c`)
|
||||
tokens := token.Tokenize(buffer)
|
||||
assert.Equal(t, token.Count(tokens, buffer, token.Identifier, "a"), 1)
|
||||
assert.Equal(t, token.Count(tokens, buffer, token.Identifier, "b"), 2)
|
||||
assert.Equal(t, token.Count(tokens, buffer, token.Identifier, "c"), 3)
|
||||
assert.Equal(t, token.Count(tokens, buffer, token.Identifier, "d"), 0)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue