diff options
author | Russ Cox <rsc@golang.org> | 2009-05-11 14:10:34 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-05-11 14:10:34 -0700 |
commit | 3619f1ea6a85b08f8c079b61115c567dd2e51f33 (patch) | |
tree | 979d1eb0ea7a8087a22d52e9e01b689950238d7f /test | |
parent | 5a11a46e2dff0e31d8568fe4680f71175c2e38b5 (diff) | |
download | go-git-3619f1ea6a85b08f8c079b61115c567dd2e51f33.tar.gz |
change utf8.FullRuneInString and utf8.DecodeRuneInString
to use single string argument instead of string, index.
R=r
DELTA=136 (9 added, 7 deleted, 120 changed)
OCL=28642
CL=28644
Diffstat (limited to 'test')
-rw-r--r-- | test/stringrange.go | 2 | ||||
-rw-r--r-- | test/utf.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/stringrange.go b/test/stringrange.go index 32ed1e5f02..6169e973b8 100644 --- a/test/stringrange.go +++ b/test/stringrange.go @@ -21,7 +21,7 @@ func main() { ok := true; cnum := 0; for i, c = range s { - rune, size := utf8.DecodeRuneInString(s, i); // check it another way + rune, size := utf8.DecodeRuneInString(s[i:len(s)]); // check it another way if i != offset { fmt.Printf("unexpected offset %d not %d\n", i, offset); ok = false; diff --git a/test/utf.go b/test/utf.go index a93cb69dbb..59b0ffaa93 100644 --- a/test/utf.go +++ b/test/utf.go @@ -23,7 +23,7 @@ func main() { var l = len(s); for w, i, j := 0,0,0; i < l; i += w { var r int; - r, w = utf8.DecodeRuneInString(s, i); + r, w = utf8.DecodeRuneInString(s[i:len(s)]); if w == 0 { panic("zero width in string") } if r != chars[j] { panic("wrong value from string") } j++; |