| // Copyright 2009 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Test UTF-8 in strings and character constants. |
| for w, i, j := 0, 0, 0; i < l; i += w { |
| r, w = utf8.DecodeRuneInString(s[i:len(s)]) |
| panic("zero width in string") |
| panic("wrong value from string") |
| // encoded as bytes: 'a' 'b' 'c' e6 97 a5 e6 9c ac e8 aa 9e |
| panic("wrong length constructing array") |
| for w, i, j := 0, 0, 0; i < L; i += w { |
| r, w = utf8.DecodeRune(a[i:L]) |
| panic("zero width in bytes") |
| panic("wrong value from bytes") |