]> Cypherpunks.ru repositories - gostls13.git/blob - test/char_lit.go
fix bug depot:
[gostls13.git] / test / char_lit.go
1 // $G $F.go && $L $F.$A &&./$A.out
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 func main() {
10   var i uint64 =
11     ' ' +
12     'a' +
13     'ä' +
14     '本' +
15     '\a' +
16     '\b' +
17     '\f' +
18     '\n' +
19     '\r' +
20     '\t' +
21     '\v' +
22     '\\' +
23     '\'' +
24     '\000' +
25     '\123' +
26     '\x00' +
27     '\xca' +
28     '\xFE' +
29     '\u0123' +
30     '\ubabe' +
31     '\U0123ABCD' +
32     '\Ucafebabe'
33   ;
34   if '\Ucafebabe' != 0xcafebabe {
35         print("cafebabe wrong\n");
36         sys.exit(1)
37   }
38   if i != 0xcc238de1 {
39         print("number is ", i, " should be ", 0xcc238de1, "\n");
40         sys.exit(1)
41   }
42 }