]> Cypherpunks repositories - gostls13.git/commitdiff
bytes, strings: rename field in CutSuffix tests
authorfangguizhen <1297394526@qq.com>
Thu, 19 Jan 2023 03:12:12 +0000 (03:12 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 20 Jan 2023 01:25:45 +0000 (01:25 +0000)
Change-Id: I63181f6540fc1bfcfc988a16bf9fafbd3575cfdf
GitHub-Last-Rev: d90528730a92a087866c1bfc227a0a0bf1cdffbe
GitHub-Pull-Request: golang/go#57909
Reviewed-on: https://go-review.googlesource.com/c/go/+/462284
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/bytes/bytes_test.go
src/strings/strings_test.go

index f58f18c461bb39cb63a419c12cb2f9313a4b2207..fc2824485aae85ddb344bc9eab61df39393b16c1 100644 (file)
@@ -1728,7 +1728,7 @@ func TestCutPrefix(t *testing.T) {
 
 var cutSuffixTests = []struct {
        s, sep string
-       after  string
+       before string
        found  bool
 }{
        {"abc", "bc", "a", true},
@@ -1741,8 +1741,8 @@ var cutSuffixTests = []struct {
 
 func TestCutSuffix(t *testing.T) {
        for _, tt := range cutSuffixTests {
-               if after, found := CutSuffix([]byte(tt.s), []byte(tt.sep)); string(after) != tt.after || found != tt.found {
-                       t.Errorf("CutSuffix(%q, %q) = %q, %v, want %q, %v", tt.s, tt.sep, after, found, tt.after, tt.found)
+               if before, found := CutSuffix([]byte(tt.s), []byte(tt.sep)); string(before) != tt.before || found != tt.found {
+                       t.Errorf("CutSuffix(%q, %q) = %q, %v, want %q, %v", tt.s, tt.sep, before, found, tt.before, tt.found)
                }
        }
 }
index 3991d127511b15ae2b43faf0132de59dcf9f1d93..5143ec86c958e7ce449a8b5e55b16b9aaaf90504 100644 (file)
@@ -1668,7 +1668,7 @@ func TestCutPrefix(t *testing.T) {
 
 var cutSuffixTests = []struct {
        s, sep string
-       after  string
+       before string
        found  bool
 }{
        {"abc", "bc", "a", true},
@@ -1681,8 +1681,8 @@ var cutSuffixTests = []struct {
 
 func TestCutSuffix(t *testing.T) {
        for _, tt := range cutSuffixTests {
-               if after, found := CutSuffix(tt.s, tt.sep); after != tt.after || found != tt.found {
-                       t.Errorf("CutSuffix(%q, %q) = %q, %v, want %q, %v", tt.s, tt.sep, after, found, tt.after, tt.found)
+               if before, found := CutSuffix(tt.s, tt.sep); before != tt.before || found != tt.found {
+                       t.Errorf("CutSuffix(%q, %q) = %q, %v, want %q, %v", tt.s, tt.sep, before, found, tt.before, tt.found)
                }
        }
 }