File: reader_test.go

package info (click to toggle)
golang-github-yuin-goldmark 1.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,564 kB
  • sloc: ansic: 76; makefile: 52
file content (16 lines) | stat: -rw-r--r-- 294 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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")
	}
}