aboutsummaryrefslogtreecommitdiff
path: root/test/string_lit.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2008-07-07 14:07:46 -0700
committerRob Pike <r@golang.org>2008-07-07 14:07:46 -0700
commit5b904a3bdee22529d4f6c42aa83c98c5d895eadb (patch)
treebc77d683442d0f051be4f2a98d3456297c9f2411 /test/string_lit.go
parent0d079a5362e1517ab178c8cd792eeb1394f8cccb (diff)
downloadgo-5b904a3bdee22529d4f6c42aa83c98c5d895eadb.tar.gz
go-5b904a3bdee22529d4f6c42aa83c98c5d895eadb.zip
update to Unicode 5
SVN=126184
Diffstat (limited to 'test/string_lit.go')
-rw-r--r--test/string_lit.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/string_lit.go b/test/string_lit.go
index f4f123c9c0..9ef8f931d3 100644
--- a/test/string_lit.go
+++ b/test/string_lit.go
@@ -75,5 +75,14 @@ func main() {
`\000\123\x00\312\xFE\u0123\ubabe\U0000babe`,
"backslashes 2 (backquote)");
assert("\\x\\u\\U\\", `\x\u\U\`, "backslash 3 (backquote)");
+
+ // test large runes. perhaps not the most logical place for this test.
+ var r int32;
+ 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");
sys.exit(ecode);
}