Imported Upstream version 1.0.1

This commit is contained in:
Sébastien Delafond
2017-07-04 14:45:08 +02:00
parent 1ee35b841d
commit 4f12259bc0
5531 changed files with 1834599 additions and 742844 deletions
+20
View File
@@ -0,0 +1,20 @@
package pb
import "testing"
func Test_RuneCount(t *testing.T) {
s := string([]byte{
27, 91, 51, 49, 109, // {Red}
72, 101, 108, 108, 111, // Hello
44, 32, // ,
112, 108, 97, 121, 103, 114, 111, 117, 110, 100, // Playground
27, 91, 48, 109, // {Reset}
})
if e, l := 17, escapeAwareRuneCountInString(s); l != e {
t.Errorf("Invalid length %d, expected %d", l, e)
}
s = "進捗 "
if e, l := 5, escapeAwareRuneCountInString(s); l != e {
t.Errorf("Invalid length %d, expected %d", l, e)
}
}