summaryrefslogtreecommitdiff
path: root/src/lib/utf8_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/utf8_test.go')
-rw-r--r--src/lib/utf8_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/utf8_test.go b/src/lib/utf8_test.go
index e35aff938..966b2c975 100644
--- a/src/lib/utf8_test.go
+++ b/src/lib/utf8_test.go
@@ -98,6 +98,17 @@ func TestEncodeRune(t *testing.T) {
}
}
+func TestEncodeRuneToString(t *testing.T) {
+ for i := 0; i < len(utf8map); i++ {
+ m := utf8map[i];
+ s := m.str;
+ s1 := utf8.EncodeRuneToString(m.rune);
+ if s != s1 {
+ t.Errorf("EncodeRuneToString(0x%04x) = %s want %s", m.rune, s1, s);
+ }
+ }
+}
+
func TestDecodeRune(t *testing.T) {
for i := 0; i < len(utf8map); i++ {
m := utf8map[i];