1 // $G $F.go && $L $F.$A && ./$A.out
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.
18 for i := 0; i < 6; i++ {
19 s += string(chars[i]);
22 for w, i, j := 0,0,0; i < l; i += w {
24 r, w = sys.stringtorune(s, i);
25 if w == 0 { panic("zero width in string") }
26 if r != chars[j] { panic("wrong value from string") }
29 // encoded as bytes: 'a' 'b' 'c' e6 97 a5 e6 9c ac e8 aa 9e
31 if L != l { panic("wrong length constructing array") }
45 for w, i, j := 0,0,0; i < L; i += w {
47 r, w = sys.bytestorune(&a[0], i, L);
48 if w == 0 { panic("zero width in bytes") }
49 if r != chars[j] { panic("wrong value from bytes") }