bytes, strings: rename field in CutSuffix tests

Change-Id: I63181f6540fc1bfcfc988a16bf9fafbd3575cfdf
GitHub-Last-Rev: d90528730a
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>
This commit is contained in:
fangguizhen 2023-01-19 03:12:12 +00:00 committed by Gopher Robot
parent ae400d003f
commit e590afcf2c
2 changed files with 6 additions and 6 deletions

View 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)
}
}
}