cri-o/vendor/gopkg.in/cheggaaa/pb.v1/runecount_test.go
Mrunal Patel 8e5b17cf13 Switch to github.com/golang/dep for vendoring
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-01-31 16:45:59 -08:00

20 lines
508 B
Go

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)
}
}