]> Cypherpunks.ru repositories - gostls13.git/commitdiff
strconv: add missing function name, avoid unnecessary raw string
authorLuka Krmpotić <luka.krmpotic@gmail.com>
Mon, 21 Aug 2023 23:17:31 +0000 (23:17 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 24 Aug 2023 18:08:43 +0000 (18:08 +0000)
Change-Id: Iecd68f69f5265f1a4ea41b90aa819ce68fe55908
GitHub-Last-Rev: 4d1f4a1bc2740fc19bbb4768009ccfea1c8eb5bc
GitHub-Pull-Request: golang/go#62177
Reviewed-on: https://go-review.googlesource.com/c/go/+/521277
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>

src/strconv/atob_test.go

index 28f469f5854d8a504674e88cab58a9f2d5b98d13..40d43a9f8f9ba6970b08a372e5d1a8280ed710e4 100644 (file)
@@ -39,19 +39,19 @@ func TestParseBool(t *testing.T) {
                if test.err != nil {
                        // expect an error
                        if e == nil {
-                               t.Errorf("%s: expected %s but got nil", test.in, test.err)
+                               t.Errorf("ParseBool(%s) = nil; want %s", test.in, test.err)
                        } else {
                                // NumError assertion must succeed; it's the only thing we return.
-                               if test.err != e.(*NumError).Err {
-                                       t.Errorf("%s: expected %s but got %s", test.in, test.err, e)
+                               if e.(*NumError).Err != test.err {
+                                       t.Errorf("ParseBool(%s) = %s; want %s", test.in, e, test.err)
                                }
                        }
                } else {
                        if e != nil {
-                               t.Errorf("%s: expected no error but got %s", test.in, e)
+                               t.Errorf("ParseBool(%s) = %s; want nil", test.in, e)
                        }
                        if b != test.out {
-                               t.Errorf("%s: expected %t but got %t", test.in, test.out, b)
+                               t.Errorf("ParseBool(%s) = %t; want %t", test.in, b, test.out)
                        }
                }
        }
@@ -65,7 +65,7 @@ var boolString = map[bool]string{
 func TestFormatBool(t *testing.T) {
        for b, s := range boolString {
                if f := FormatBool(b); f != s {
-                       t.Errorf(`FormatBool(%v): expected %q but got %q`, b, s, f)
+                       t.Errorf("FormatBool(%v) = %q; want %q", b, f, s)
                }
        }
 }
@@ -85,7 +85,7 @@ func TestAppendBool(t *testing.T) {
        for _, test := range appendBoolTests {
                b := AppendBool(test.in, test.b)
                if !bytes.Equal(b, test.out) {
-                       t.Errorf("AppendBool(%q, %v): expected %q but got %q", test.in, test.b, test.out, b)
+                       t.Errorf("AppendBool(%q, %v) = %q; want %q", test.in, test.b, b, test.out)
                }
        }
 }