Source file test/rune.go

     1  // compile
     2  
     3  // Copyright 2011 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  // Test rune constants, expressions and types.
     8  // Compiles but does not run.
     9  
    10  package rune
    11  
    12  var (
    13  	r0 = 'a'
    14  	r1 = 'a'+1
    15  	r2 = 1+'a'
    16  	r3 = 'a'*2
    17  	r4 = 'a'/2
    18  	r5 = 'a'<<1
    19  	r6 = 'b'<<2
    20  	r7 int32
    21  
    22  	r = []rune{r0, r1, r2, r3, r4, r5, r6, r7}
    23  )
    24  
    25  var (
    26  	f0 = 1.2
    27  	f1 = 1.2/'a'
    28  
    29  	f = []float64{f0, f1}
    30  )
    31  
    32  var (
    33  	i0 = 1
    34  	i1 = 1<<'\x01'
    35  
    36  	i = []int{i0, i1}
    37  )
    38  
    39  const (
    40  	maxRune = '\U0010FFFF'
    41  )
    42  
    43  var (
    44  	b0 = maxRune < r0
    45  
    46  	b = []bool{b0}
    47  )
    48  

View as plain text