chore: initial gomark plugin (#1678)

chore: initial gomark folder
This commit is contained in:
boojack
2023-05-18 21:33:18 +08:00
committed by GitHub
parent a07d5d38d6
commit 88799d469c
11 changed files with 174 additions and 0 deletions

View File

@ -0,0 +1,40 @@
package tokenizer
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestTokenize(t *testing.T) {
tests := []struct {
text string
tokens []*Token
}{
{
text: "*Hello world!",
tokens: []*Token{
{
Type: Star,
Value: "*",
},
{
Type: Text,
Value: "Hello",
},
{
Type: Space,
Value: " ",
},
{
Type: Text,
Value: "world!",
},
},
},
}
for _, test := range tests {
result := tokenize(test.text)
require.Equal(t, test.tokens, result)
}
}