2012-02-18 19:19:43 -07:00
|
|
|
// run
|
2008-03-19 16:45:07 -06:00
|
|
|
|
|
|
|
// 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.
|
|
|
|
|
2012-02-18 19:19:43 -07:00
|
|
|
// Test character literal syntax.
|
|
|
|
|
2008-03-19 16:45:07 -06:00
|
|
|
package main
|
|
|
|
|
2009-05-08 16:21:41 -06:00
|
|
|
import "os"
|
|
|
|
|
2008-06-27 15:15:06 -06:00
|
|
|
func main() {
|
2009-08-17 14:30:22 -06:00
|
|
|
var i uint64 =
|
|
|
|
' ' +
|
|
|
|
'a' +
|
|
|
|
'ä' +
|
|
|
|
'本' +
|
|
|
|
'\a' +
|
|
|
|
'\b' +
|
|
|
|
'\f' +
|
|
|
|
'\n' +
|
|
|
|
'\r' +
|
|
|
|
'\t' +
|
|
|
|
'\v' +
|
|
|
|
'\\' +
|
|
|
|
'\'' +
|
|
|
|
'\000' +
|
|
|
|
'\123' +
|
|
|
|
'\x00' +
|
|
|
|
'\xca' +
|
|
|
|
'\xFE' +
|
|
|
|
'\u0123' +
|
|
|
|
'\ubabe' +
|
2010-06-08 23:32:04 -06:00
|
|
|
'\U0010FFFF' +
|
|
|
|
'\U000ebabe'
|
|
|
|
if '\U000ebabe' != 0x000ebabe {
|
2010-09-03 18:36:13 -06:00
|
|
|
print("ebabe wrong\n")
|
2009-08-17 14:30:22 -06:00
|
|
|
os.Exit(1)
|
|
|
|
}
|
2010-06-08 23:32:04 -06:00
|
|
|
if i != 0x20e213 {
|
2010-09-03 18:36:13 -06:00
|
|
|
print("number is ", i, " should be ", 0x20e213, "\n")
|
2009-08-17 14:30:22 -06:00
|
|
|
os.Exit(1)
|
2010-09-03 18:36:13 -06:00
|
|
|
}
|
2008-03-19 16:45:07 -06:00
|
|
|
}
|