mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
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
This commit is contained in:
parent
bbf762582f
commit
936665f641
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user