chore: remove stretchr/testify
All checks were successful
submodules sync / sync (push) Successful in 40s
build / build (push) Successful in 1m48s
build / trigger-build-image (push) Successful in 13s

This commit is contained in:
张泊明518370910136 2025-07-17 17:33:11 -07:00
parent 43bfbba327
commit a16cf89244
2 changed files with 15 additions and 11 deletions

4
go.mod
View File

@ -12,7 +12,6 @@ require (
github.com/koding/multiconfig v0.0.0-20171124222453-69c27309b2d7
github.com/mcuadros/go-defaults v1.2.0
github.com/mitchellh/mapstructure v1.5.0
github.com/stretchr/testify v1.10.0
google.golang.org/grpc v1.73.0
google.golang.org/protobuf v1.36.6
)
@ -25,7 +24,6 @@ require (
github.com/cloudflare/circl v1.6.1 // indirect
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/camelcase v1.0.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
@ -35,7 +33,6 @@ require (
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/skeema/knownhosts v1.3.1 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
@ -46,5 +43,4 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@ -2,8 +2,6 @@ package diff
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGenerateDiffComment(t *testing.T) {
@ -17,7 +15,9 @@ func TestGenerateDiffComment(t *testing.T) {
}
comment := d.generateDiffComment(answerStr, resultStr, output)
expected := "```diff\n(2 line(s) of common prefix hidden)\n\n- line3\n- line4\n+ lineA\n+ lineB\n```\n"
assert.Equal(t, expected, comment)
if comment != expected {
t.Errorf("expected %q, got %q", expected, comment)
}
})
t.Run("HideCommonPrefix with no common prefix", func(t *testing.T) {
@ -28,7 +28,9 @@ func TestGenerateDiffComment(t *testing.T) {
}
comment := d.generateDiffComment(answerStr, resultStr, output)
expected := "```diff\n- line1\n- line2\n+ lineA\n+ lineB\n```\n"
assert.Equal(t, expected, comment)
if comment != expected {
t.Errorf("expected %q, got %q", expected, comment)
}
})
t.Run("HideCommonPrefix with identical content", func(t *testing.T) {
@ -39,7 +41,9 @@ func TestGenerateDiffComment(t *testing.T) {
}
comment := d.generateDiffComment(answerStr, resultStr, output)
expected := "```diff\n(2 line(s) of common prefix hidden)\n\n\n```\n"
assert.Equal(t, expected, comment)
if comment != expected {
t.Errorf("expected %q, got %q", expected, comment)
}
})
t.Run("HideCommonPrefix with only common prefix", func(t *testing.T) {
@ -50,7 +54,9 @@ func TestGenerateDiffComment(t *testing.T) {
}
comment := d.generateDiffComment(answerStr, resultStr, output)
expected := "```diff\n(2 line(s) of common prefix hidden)\n\n+ lineA\n```\n"
assert.Equal(t, expected, comment)
if comment != expected {
t.Errorf("expected %q, got %q", expected, comment)
}
})
t.Run("MaxDiffLines truncation", func(t *testing.T) {
@ -62,6 +68,8 @@ func TestGenerateDiffComment(t *testing.T) {
}
comment := d.generateDiffComment(answerStr, resultStr, output)
expected := "```diff\n(3 line(s) of common prefix hidden)\n\n- line4\n- line5\n- line6\n+ lineA\n+ lineB\n+ lineC\n\n(truncated)\n```\n"
assert.Equal(t, expected, comment)
if comment != expected {
t.Errorf("expected %q, got %q", expected, comment)
}
})
}