summaryrefslogtreecommitdiff
path: root/test/ken
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-06-04 16:51:47 -0700
committerRob Pike <r@golang.org>2009-06-04 16:51:47 -0700
commit1f664fc6309f648216a518d70b8b5eb5a2cb1536 (patch)
treee169dd19fd0cbc490f86f6dadde064dc7a6cb421 /test/ken
parente8922bded014d41c5919c9169d44c3eecc00ab7d (diff)
downloadgo-1f664fc6309f648216a518d70b8b5eb5a2cb1536.tar.gz
string([]int) is now implemented
R=rsc DELTA=18 (10 added, 2 deleted, 6 changed) OCL=29909 CL=29909
Diffstat (limited to 'test/ken')
-rw-r--r--test/ken/string.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/ken/string.go b/test/ken/string.go
index a823e9283..f7c02822f 100644
--- a/test/ken/string.go
+++ b/test/ken/string.go
@@ -88,15 +88,25 @@ main()
z1[2] = 'c';
c = string(&z1);
if c != "abc" {
- panic("create array ", c);
+ panic("create byte array ", c);
}
- /* create string with byte array pointer */
- z2 := new([3]byte);
+ /* create string with int array */
+ var z2 [3]int;
z2[0] = 'a';
- z2[1] = 'b';
+ z2[1] = '\u1234';
z2[2] = 'c';
- c = string(z2);
+ c = string(&z2);
+ if c != "a\u1234c" {
+ panic("create int array ", c);
+ }
+
+ /* create string with byte array pointer */
+ z3 := new([3]byte);
+ z3[0] = 'a';
+ z3[1] = 'b';
+ z3[2] = 'c';
+ c = string(z3);
if c != "abc" {
panic("create array pointer ", c);
}