goldmark/text/reader_test.go
lihuanan 023c1d9d21 feat(reader): work for cjk in findSubMatchReader
Change-Id: Id30a946c4e78e7cdaf0fa7af9300b98f754e5b80
2023-01-09 17:30:16 +08:00

16 lines
294 B
Go

package text
import (
"regexp"
"testing"
)
func TestFindSubMatchReader(t *testing.T) {
s := "微笑"
r := NewReader([]byte(":" + s + ":"))
reg := regexp.MustCompile(`:(\p{L}+):`)
match := r.FindSubMatch(reg)
if len(match) != 2 || string(match[1]) != s {
t.Fatal("no match cjk")
}
}