aboutsummaryrefslogtreecommitdiff
path: root/test/string_lit.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2013-12-12 17:17:02 -0800
committerIan Lance Taylor <iant@golang.org>2013-12-12 17:17:02 -0800
commit936665f6414f0fa0e416f734bbe46571f1fc65ac (patch)
treed148f901b8053668f04e8ab357d49023259eee6b /test/string_lit.go
parentbbf762582fd7f45ac5e145021d3f5bed2ea481b3 (diff)
downloadgo-936665f6414f0fa0e416f734bbe46571f1fc65ac.tar.gz
go-936665f6414f0fa0e416f734bbe46571f1fc65ac.zip
test: add []rune case to string_lit.go
Gccgo managed to get this case wrong. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/41490044
Diffstat (limited to 'test/string_lit.go')
-rw-r--r--test/string_lit.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/string_lit.go b/test/string_lit.go
index fea6f553d1..4751b82ccf 100644
--- a/test/string_lit.go
+++ b/test/string_lit.go
@@ -125,6 +125,11 @@ func main() {
s = string(-1)
assert(s, "\xef\xbf\xbd", "negative rune")
+ // the large rune tests yet again, with a slice.
+ rs := []rune{0x10ffff, 0x10ffff + 1, 0xD800, 0xDFFF, -1}
+ s = string(rs)
+ assert(s, "\xf4\x8f\xbf\xbf\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd", "large rune slice")
+
assert(string(gr1), gx1, "global ->[]rune")
assert(string(gr2), gx2fix, "global invalid ->[]rune")
assert(string(gb1), gx1, "->[]byte")