aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/string_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/string_test.go')
-rw-r--r--src/pkg/runtime/string_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/runtime/string_test.go b/src/pkg/runtime/string_test.go
index cd253b2349..9ed579235d 100644
--- a/src/pkg/runtime/string_test.go
+++ b/src/pkg/runtime/string_test.go
@@ -104,18 +104,18 @@ func BenchmarkRuneIterate2(b *testing.B) {
func TestStringW(t *testing.T) {
strings := []string{
"hello",
- //"a\u5566\u7788b",
+ "a\u5566\u7788b",
}
for _, s := range strings {
- var b []byte
+ var b []uint16
for _, c := range s {
- b = append(b, byte(c&255))
- b = append(b, byte(c>>8))
- if c>>16 != 0 {
+ b = append(b, uint16(c))
+ if c != rune(uint16(c)) {
t.Errorf("bad test: stringW can't handle >16 bit runes")
}
}
+ b = append(b, 0)
r := runtime.GostringW(b)
if r != s {
t.Errorf("gostringW(%v) = %s, want %s", b, r, s)