summaryrefslogtreecommitdiff
path: root/test/ken/string.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/ken/string.go')
-rw-r--r--test/ken/string.go19
1 files changed, 7 insertions, 12 deletions
diff --git a/test/ken/string.go b/test/ken/string.go
index cbedad4e8..e05108242 100644
--- a/test/ken/string.go
+++ b/test/ken/string.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
@@ -71,16 +71,14 @@ func main() {
/* create string with integer constant */
c = string('x')
if c != "x" {
- print("create int ", c)
- panic("fail")
+ panic("create int " + c)
}
/* create string with integer variable */
v := 'x'
c = string(v)
if c != "x" {
- print("create int ", c)
- panic("fail")
+ panic("create int " + c)
}
/* create string with byte array */
@@ -90,19 +88,17 @@ func main() {
z1[2] = 'c'
c = string(z1[0:])
if c != "abc" {
- print("create byte array ", c)
- panic("fail")
+ panic("create byte array " + c)
}
/* create string with int array */
- var z2 [3]int
+ var z2 [3]rune
z2[0] = 'a'
z2[1] = '\u1234'
z2[2] = 'c'
c = string(z2[0:])
if c != "a\u1234c" {
- print("create int array ", c)
- panic("fail")
+ panic("create int array " + c)
}
/* create string with byte array pointer */
@@ -112,7 +108,6 @@ func main() {
z3[2] = 'c'
c = string(z3[0:])
if c != "abc" {
- print("create array pointer ", c)
- panic("fail")
+ panic("create array pointer " + c)
}
}