3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
16 s := "\000\123\x00\xca\xFE\u0123\ubabe\U0000babe\U0010FFFFx"
17 expect := []rune{0, 0123, 0, 0xFFFD, 0xFFFD, 0x123, 0xbabe, 0xbabe, 0x10FFFF, 'x'}
24 r, size := utf8.DecodeRuneInString(s[i:len(s)]) // check it another way
26 fmt.Printf("unexpected offset %d not %d\n", i, offset)
29 if r != expect[cnum] {
30 fmt.Printf("unexpected rune %d from DecodeRuneInString: %x not %x\n", i, r, expect[cnum])
33 if c != expect[cnum] {
34 fmt.Printf("unexpected rune %d from range: %x not %x\n", i, r, expect[cnum])
41 fmt.Println("after loop i is", i, "not", len(s)-1)
50 fmt.Println("range empty string assigned to index:", i)
54 fmt.Println("range empty string assigned to value:", c)
59 fmt.Println("BUG: stringrange")