OSDN Git Service

libgo: Update to weekly.2011-11-01.
[pf3gnuchains/gcc-fork.git] / libgo / go / exp / norm / normregtest.go
index cbd73ff..e747dde 100644 (file)
@@ -16,8 +16,8 @@ import (
        "path"
        "regexp"
        "runtime"
-       "strings"
        "strconv"
+       "strings"
        "time"
        "utf8"
 )
@@ -103,7 +103,7 @@ type Test struct {
        name   string
        partnr int
        number int
-       rune   int                 // used for character by character test
+       r      rune                // used for character by character test
        cols   [cMaxColumns]string // Each has 5 entries, see below.
 }
 
@@ -174,12 +174,12 @@ func loadTestData() {
                                if err != nil {
                                        logger.Fatal(err)
                                }
-                               if test.rune == 0 {
+                               if test.r == 0 {
                                        // save for CharacterByCharacterTests
-                                       test.rune = int(r)
+                                       test.r = int(r)
                                }
                                var buf [utf8.UTFMax]byte
-                               sz := utf8.EncodeRune(buf[:], int(r))
+                               sz := utf8.EncodeRune(buf[:], rune(r))
                                test.cols[j-1] += string(buf[:sz])
                        }
                }
@@ -198,7 +198,7 @@ func cmpResult(t *Test, name string, f norm.Form, gold, test, result string) {
                if errorCount > 20 {
                        return
                }
-               st, sr, sg := []int(test), []int(result), []int(gold)
+               st, sr, sg := []rune(test), []rune(result), []rune(gold)
                logger.Printf("%s:%s: %s(%X)=%X; want:%X: %s",
                        t.Name(), name, fstr[f], st, sr, sg, t.name)
        }
@@ -210,7 +210,7 @@ func cmpIsNormal(t *Test, name string, f norm.Form, test string, result, want bo
                if errorCount > 20 {
                        return
                }
-               logger.Printf("%s:%s: %s(%X)=%v; want: %v", t.Name(), name, fstr[f], []int(test), result, want)
+               logger.Printf("%s:%s: %s(%X)=%v; want: %v", t.Name(), name, fstr[f], []rune(test), result, want)
        }
 }
 
@@ -243,13 +243,13 @@ func CharacterByCharacterTests() {
        tests := part[1].tests
        last := 0
        for i := 0; i <= len(tests); i++ { // last one is special case
-               var rune int
+               var r int
                if i == len(tests) {
-                       rune = 0x2FA1E // Don't have to go to 0x10FFFF
+                       r = 0x2FA1E // Don't have to go to 0x10FFFF
                } else {
-                       rune = tests[i].rune
+                       r = tests[i].r
                }
-               for last++; last < rune; last++ {
+               for last++; last < r; last++ {
                        // Check all characters that were not explicitly listed in the test.
                        t := &Test{partnr: 1, number: -1}
                        char := string(last)