Russ Cox | 6cd8537 | 2010-06-10 13:30:39 -0700 | [diff] [blame] | 1 | // errchk $G -e $F.go |
| 2 | |
| 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. |
| 6 | |
| 7 | package main |
| 8 | |
| 9 | const ( |
| 10 | // check that surrogate pair elements are invalid |
| 11 | // (d800-dbff, dc00-dfff). |
| 12 | _ = '\ud7ff' // ok |
Ian Lance Taylor | 472cd3a | 2010-08-31 11:43:52 -0700 | [diff] [blame] | 13 | _ = '\ud800' // ERROR "Unicode|unicode" |
| 14 | _ = "\U0000D999" // ERROR "Unicode|unicode" |
| 15 | _ = '\udc01' // ERROR "Unicode|unicode" |
| 16 | _ = '\U0000dddd' // ERROR "Unicode|unicode" |
| 17 | _ = '\udfff' // ERROR "Unicode|unicode" |
Russ Cox | 6cd8537 | 2010-06-10 13:30:39 -0700 | [diff] [blame] | 18 | _ = '\ue000' // ok |
| 19 | _ = '\U0010ffff' // ok |
Ian Lance Taylor | 472cd3a | 2010-08-31 11:43:52 -0700 | [diff] [blame] | 20 | _ = '\U00110000' // ERROR "Unicode|unicode" |
Russ Cox | 6cd8537 | 2010-06-10 13:30:39 -0700 | [diff] [blame] | 21 | _ = "abc\U0010ffffdef" // ok |
Ian Lance Taylor | 472cd3a | 2010-08-31 11:43:52 -0700 | [diff] [blame] | 22 | _ = "abc\U00110000def" // ERROR "Unicode|unicode" |
| 23 | _ = '\Uffffffff' // ERROR "Unicode|unicode" |
Russ Cox | 6cd8537 | 2010-06-10 13:30:39 -0700 | [diff] [blame] | 24 | ) |
| 25 | |