summaryrefslogtreecommitdiff
path: root/test/stringrange.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2010-09-04 10:36:13 +1000
committerRob Pike <r@golang.org>2010-09-04 10:36:13 +1000
commit4f61fc96b2788be7cbfc6f7a72acef3d3feeeb6c (patch)
tree094ba2238e5596358b6ae4db5789c7d1fee4ecb7 /test/stringrange.go
parentcd8f4cd2068964bfa12e10cd094d41ddd725af4f (diff)
downloadgo-git-4f61fc96b2788be7cbfc6f7a72acef3d3feeeb6c.tar.gz
test: remove semiocolons.
The ken directory is untouched so we have some examples with explicit semis. R=gri CC=golang-dev https://golang.org/cl/2157041
Diffstat (limited to 'test/stringrange.go')
-rw-r--r--test/stringrange.go54
1 files changed, 27 insertions, 27 deletions
diff --git a/test/stringrange.go b/test/stringrange.go
index 9215b95fa4..d5ada2628d 100644
--- a/test/stringrange.go
+++ b/test/stringrange.go
@@ -7,55 +7,55 @@
package main
import (
- "fmt";
- "os";
- "utf8";
+ "fmt"
+ "os"
+ "utf8"
)
func main() {
- s := "\000\123\x00\xca\xFE\u0123\ubabe\U0000babe\U0010FFFFx";
- expect := []int{ 0, 0123, 0, 0xFFFD, 0xFFFD, 0x123, 0xbabe, 0xbabe, 0x10FFFF, 'x' };
- offset := 0;
- var i, c int;
- ok := true;
- cnum := 0;
+ s := "\000\123\x00\xca\xFE\u0123\ubabe\U0000babe\U0010FFFFx"
+ expect := []int{ 0, 0123, 0, 0xFFFD, 0xFFFD, 0x123, 0xbabe, 0xbabe, 0x10FFFF, 'x' }
+ offset := 0
+ var i, c int
+ ok := true
+ cnum := 0
for i, c = range s {
- rune, size := utf8.DecodeRuneInString(s[i:len(s)]); // check it another way
+ rune, size := utf8.DecodeRuneInString(s[i:len(s)]) // check it another way
if i != offset {
- fmt.Printf("unexpected offset %d not %d\n", i, offset);
- ok = false;
+ fmt.Printf("unexpected offset %d not %d\n", i, offset)
+ ok = false
}
if rune != expect[cnum] {
- fmt.Printf("unexpected rune %d from DecodeRuneInString: %x not %x\n", i, rune, expect[cnum]);
- ok = false;
+ fmt.Printf("unexpected rune %d from DecodeRuneInString: %x not %x\n", i, rune, expect[cnum])
+ ok = false
}
if c != expect[cnum] {
- fmt.Printf("unexpected rune %d from range: %x not %x\n", i, rune, expect[cnum]);
- ok = false;
+ fmt.Printf("unexpected rune %d from range: %x not %x\n", i, rune, expect[cnum])
+ ok = false
}
- offset += size;
- cnum++;
+ offset += size
+ cnum++
}
if i != len(s)-1 {
- fmt.Println("after loop i is", i, "not", len(s)-1);
- ok = false;
+ fmt.Println("after loop i is", i, "not", len(s)-1)
+ ok = false
}
- i = 12345;
- c = 23456;
+ i = 12345
+ c = 23456
for i, c = range "" {
}
if i != 12345 {
- fmt.Println("range empty string assigned to index:", i);
- ok = false;
+ fmt.Println("range empty string assigned to index:", i)
+ ok = false
}
if c != 23456 {
- fmt.Println("range empty string assigned to value:", c);
- ok = false;
+ fmt.Println("range empty string assigned to value:", c)
+ ok = false
}
if !ok {
- fmt.Println("BUG: stringrange");
+ fmt.Println("BUG: stringrange")
os.Exit(1)
}
}