summaryrefslogtreecommitdiff
path: root/src/pkg/strings/strings_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/strings/strings_test.go')
-rw-r--r--src/pkg/strings/strings_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/strings/strings_test.go b/src/pkg/strings/strings_test.go
index 7925ae835..a01285e95 100644
--- a/src/pkg/strings/strings_test.go
+++ b/src/pkg/strings/strings_test.go
@@ -66,7 +66,7 @@ var lastIndexTests = []IndexTest {
// Execute f on each test case. funcName should be the name of f; it's used
// in failure reports.
func runIndexTests(t *testing.T, f func(s, sep string) int, funcName string, testCases []IndexTest) {
- for i,test := range testCases {
+ for _, test := range testCases {
actual := f(test.s, test.sep);
if actual != test.out {
t.Errorf("%s(%q,%q) = %v; want %v", funcName, test.s, test.sep, actual, test.out);
@@ -149,7 +149,7 @@ type StringTest struct {
// Execute f on each test case. funcName should be the name of f; it's used
// in failure reports.
func runStringTests(t *testing.T, f func(string) string, funcName string, testCases []StringTest) {
- for i, tc := range testCases {
+ for _, tc := range testCases {
actual := f(tc.in);
if actual != tc.out {
t.Errorf("%s(%q) = %q; want %q", funcName, tc.in, actual, tc.out);
@@ -237,8 +237,8 @@ func equal(m string, s1, s2 string, t *testing.T) bool {
if i > len(e2) {
break
}
- r1, w := utf8.DecodeRuneInString(c1);
- r2, w := utf8.DecodeRuneInString(e2[i]);
+ r1, _ := utf8.DecodeRuneInString(c1);
+ r2, _ := utf8.DecodeRuneInString(e2[i]);
if r1 != r2 {
t.Errorf("%s diff at %d: U+%04X U+%04X", m, i, r1, r2)
}