summaryrefslogtreecommitdiff
path: root/test/string_lit.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-12-09 16:55:03 -0800
committerRobert Griesemer <gri@golang.org>2009-12-09 16:55:03 -0800
commit4bac20d23b62277fab6e422555c4dda60b648d10 (patch)
treec25e65fbecf9091ed66578fddd6bf6b2090d8277 /test/string_lit.go
parent0f44bfd68d6bca1dadf3afcac9dc7ff0a409370c (diff)
downloadgo-4bac20d23b62277fab6e422555c4dda60b648d10.tar.gz
- gofmt these files
- remove use of implicit string concatenation - these appear to be the only files correctly compiling under test that used implicit string concatenation R=rsc http://codereview.appspot.com/172043
Diffstat (limited to 'test/string_lit.go')
-rw-r--r--test/string_lit.go52
1 files changed, 26 insertions, 26 deletions
diff --git a/test/string_lit.go b/test/string_lit.go
index e9e7cff23..547be8003 100644
--- a/test/string_lit.go
+++ b/test/string_lit.go
@@ -8,7 +8,7 @@ package main
import "os"
-var ecode int;
+var ecode int
func assert(a, b, c string) {
if a != b {
@@ -16,19 +16,19 @@ func assert(a, b, c string) {
print("FAIL: ", c, ": ", a, "!=", b, "\n");
var max int = len(a);
if len(b) > max {
- max = len(b);
+ max = len(b)
}
for i := 0; i < max; i++ {
ac := 0;
bc := 0;
if i < len(a) {
- ac = int(a[i]);
+ ac = int(a[i])
}
if i < len(b) {
- bc = int(b[i]);
+ bc = int(b[i])
}
if ac != bc {
- print("\ta[", i, "] = ", ac, "; b[", i, "] =", bc, "\n");
+ print("\ta[", i, "] = ", ac, "; b[", i, "] =", bc, "\n")
}
}
}
@@ -37,25 +37,25 @@ func assert(a, b, c string) {
func main() {
ecode = 0;
s :=
- ""
- " "
- "'`"
- "a"
- "ä"
- "本"
- "\a\b\f\n\r\t\v\\\""
- "\000\123\x00\xca\xFE\u0123\ubabe\U0000babe"
+ "" +
+ " " +
+ "'`" +
+ "a" +
+ "ä" +
+ "本" +
+ "\a\b\f\n\r\t\v\\\"" +
+ "\000\123\x00\xca\xFE\u0123\ubabe\U0000babe" +
+
+ `` +
+ ` ` +
+ `'"` +
+ `a` +
+ `ä` +
+ `本` +
+ `\a\b\f\n\r\t\v\\\'` +
+ `\000\123\x00\xca\xFE\u0123\ubabe\U0000babe` +
+ `\x\u\U\`;
- ``
- ` `
- `'"`
- `a`
- `ä`
- `本`
- `\a\b\f\n\r\t\v\\\'`
- `\000\123\x00\xca\xFE\u0123\ubabe\U0000babe`
- `\x\u\U\`
- ;
assert("", ``, "empty");
assert(" ", " ", "blank");
assert("\x61", "a", "lowercase a");
@@ -65,11 +65,11 @@ func main() {
assert("\u672c", "本", "nihon");
assert("\u672c", `本`, "nihon (backquote)");
assert("\x07\x08\x0c\x0a\x0d\x09\x0b\x5c\x22",
- "\a\b\f\n\r\t\v\\\"",
- "backslashes");
+ "\a\b\f\n\r\t\v\\\"",
+ "backslashes");
assert("\\a\\b\\f\\n\\r\\t\\v\\\\\\\"",
`\a\b\f\n\r\t\v\\\"`,
- "backslashes (backquote)");
+ "backslashes (backquote)");
assert("\x00\x53\000\xca\376S몾몾",
"\000\123\x00\312\xFE\u0053\ubabe\U0000babe",
"backslashes 2");