Home | History | Annotate | Download | only in test
      1 // cmpout
      2 
      3 // Copyright 2014 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 internal print routines that are generated
      8 // by the print builtin.  This test is not exhaustive,
      9 // we're just checking that the formatting is correct.
     10 
     11 package main
     12 
     13 func main() {
     14 	println((interface{})(nil)) // printeface
     15 	println((interface {        // printiface
     16 		f()
     17 	})(nil))
     18 	println((map[int]int)(nil)) // printpointer
     19 	println(([]int)(nil))       // printslice
     20 	println(int64(-7))          // printint
     21 	println(uint64(7))          // printuint
     22 	println(8.0)                // printfloat
     23 	println(complex(9.0, 10.0)) // printcomplex
     24 	println(true)               // printbool
     25 	println(false)              // printbool
     26 	println("hello")            // printstring
     27 	println("one", "two")       // printsp
     28 
     29 	// test goprintf
     30 	defer println((interface{})(nil))
     31 	defer println((interface{f()})(nil))
     32 	defer println((map[int]int)(nil))
     33 	defer println(([]int)(nil))
     34 	defer println(int64(-11))
     35 	defer println(uint64(12))
     36 	defer println(13.0)
     37 	defer println(complex(14.0, 15.0))
     38 	defer println(true)
     39 	defer println(false)
     40 	defer println("hello")
     41 	defer println("one", "two")
     42 }
     43