aboutsummaryrefslogtreecommitdiff
path: root/test/string_lit.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-10-25 22:20:02 -0700
committerRuss Cox <rsc@golang.org>2011-10-25 22:20:02 -0700
commitdb33959797ad8ef1e86725db62aafb40297ea725 (patch)
tree83205f46a52d3ebc4a22cc151968d958b8524b28 /test/string_lit.go
parent6ed3fa6553d84391157eae963eeee5f20b6dca74 (diff)
downloadgo-db33959797ad8ef1e86725db62aafb40297ea725.tar.gz
go-db33959797ad8ef1e86725db62aafb40297ea725.zip
cgo, goyacc, go/build, html, http, path, path/filepath, testing/quick, test: use rune
Nothing terribly interesting here. R=golang-dev, bradfitz, gri, r CC=golang-dev https://golang.org/cl/5300043
Diffstat (limited to 'test/string_lit.go')
-rw-r--r--test/string_lit.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/string_lit.go b/test/string_lit.go
index 4358dd8e82..c702a05e91 100644
--- a/test/string_lit.go
+++ b/test/string_lit.go
@@ -35,14 +35,14 @@ func assert(a, b, c string) {
}
const (
- gx1 = "aä本☺"
- gx2 = "aä\xFF\xFF本☺"
+ gx1 = "aä本☺"
+ gx2 = "aä\xFF\xFF本☺"
gx2fix = "aä\uFFFD\uFFFD本☺"
)
var (
- gr1 = []int(gx1)
- gr2 = []int(gx2)
+ gr1 = []rune(gx1)
+ gr2 = []rune(gx2)
gb1 = []byte(gx1)
gb2 = []byte(gx2)
)
@@ -93,26 +93,26 @@ func main() {
// test large runes. perhaps not the most logical place for this test.
var r int32
- r = 0x10ffff; // largest rune value
+ r = 0x10ffff // largest rune value
s = string(r)
assert(s, "\xf4\x8f\xbf\xbf", "largest rune")
r = 0x10ffff + 1
s = string(r)
assert(s, "\xef\xbf\xbd", "too-large rune")
- assert(string(gr1), gx1, "global ->[]int")
- assert(string(gr2), gx2fix, "global invalid ->[]int")
+ assert(string(gr1), gx1, "global ->[]rune")
+ assert(string(gr2), gx2fix, "global invalid ->[]rune")
assert(string(gb1), gx1, "->[]byte")
assert(string(gb2), gx2, "global invalid ->[]byte")
var (
- r1 = []int(gx1)
- r2 = []int(gx2)
+ r1 = []rune(gx1)
+ r2 = []rune(gx2)
b1 = []byte(gx1)
b2 = []byte(gx2)
)
- assert(string(r1), gx1, "->[]int")
- assert(string(r2), gx2fix, "invalid ->[]int")
+ assert(string(r1), gx1, "->[]rune")
+ assert(string(r2), gx2fix, "invalid ->[]rune")
assert(string(b1), gx1, "->[]byte")
assert(string(b2), gx2, "invalid ->[]byte")