summaryrefslogtreecommitdiff
path: root/src/lib/utf8_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-04-15 20:27:45 -0700
committerRuss Cox <rsc@golang.org>2009-04-15 20:27:45 -0700
commit0ada410ece61f805c66b63eb15bb8584c3e584cd (patch)
tree16cfcc3cc7d82aa01da1b152e520297da5afc88a /src/lib/utf8_test.go
parent398d9c9582bcde24740e65cc4e5c9b97c5bcac40 (diff)
downloadgolang-0ada410ece61f805c66b63eb15bb8584c3e584cd.tar.gz
code changes for array conversion.
as a reminder, the old conversion was that you could write var arr [10]byte; var slice []byte; slice = arr; but now you have to write slice = &arr; the change eliminates an implicit &, so that the only implicit &s left are in the . operator and in string(arr). also, removed utf8.EncodeRuneToString in favor of string(rune). R=r DELTA=83 (1 added, 23 deleted, 59 changed) OCL=27531 CL=27534
Diffstat (limited to 'src/lib/utf8_test.go')
-rw-r--r--src/lib/utf8_test.go13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/lib/utf8_test.go b/src/lib/utf8_test.go
index 966b2c975..1f29cb82d 100644
--- a/src/lib/utf8_test.go
+++ b/src/lib/utf8_test.go
@@ -90,7 +90,7 @@ func TestEncodeRune(t *testing.T) {
m := utf8map[i];
b := bytes(m.str);
var buf [10]byte;
- n := utf8.EncodeRune(m.rune, buf);
+ n := utf8.EncodeRune(m.rune, &buf);
b1 := buf[0:n];
if !equalBytes(b, b1) {
t.Errorf("EncodeRune(0x%04x) = %q want %q", m.rune, b1, b);
@@ -98,17 +98,6 @@ 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];