...

Source file src/github.com/yuin/goldmark/text/reader_test.go

Documentation: github.com/yuin/goldmark/text

     1  package text
     2  
     3  import (
     4  	"regexp"
     5  	"testing"
     6  )
     7  
     8  func TestFindSubMatchReader(t *testing.T) {
     9  	s := "微笑"
    10  	r := NewReader([]byte(":" + s + ":"))
    11  	reg := regexp.MustCompile(`:(\p{L}+):`)
    12  	match := r.FindSubMatch(reg)
    13  	if len(match) != 2 || string(match[1]) != s {
    14  		t.Fatal("no match cjk")
    15  	}
    16  }
    17  

View as plain text