]> Cypherpunks repositories - gostls13.git/commitdiff
test: add []rune case to string_lit.go
authorIan Lance Taylor <iant@golang.org>
Fri, 13 Dec 2013 01:17:02 +0000 (17:17 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 13 Dec 2013 01:17:02 +0000 (17:17 -0800)
Gccgo managed to get this case wrong.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41490044

test/string_lit.go

index fea6f553d104ad33ee976523d1427722b2b493f3..4751b82ccf49836ab17a2dfb345623f8afa6ec4f 100644 (file)
@@ -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")