diff options
author | TheFox0x7 <thefox0x7@gmail.com> | 2025-01-09 02:21:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-09 09:21:47 +0800 |
commit | 2a02734f93c0091275c77e370b7eed03b2c5f18e (patch) | |
tree | 2dcad43764cbfa254f7c6d355f5a14ffdcdb109a /modules/analyze | |
parent | fa9191b7b9373666f30a55bbc63b932833bceefe (diff) | |
download | gitea-2a02734f93c0091275c77e370b7eed03b2c5f18e.tar.gz gitea-2a02734f93c0091275c77e370b7eed03b2c5f18e.zip |
Refactor older tests to use testify (#33140)
Refactor checks to use assert/require
Use require.Eventually for waiting in elastic and meilisearch tests
Use require to exit early instead of assert
Diffstat (limited to 'modules/analyze')
-rw-r--r-- | modules/analyze/vendor_test.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/analyze/vendor_test.go b/modules/analyze/vendor_test.go index aafd3c431b..02a51d4c8f 100644 --- a/modules/analyze/vendor_test.go +++ b/modules/analyze/vendor_test.go @@ -3,7 +3,11 @@ package analyze -import "testing" +import ( + "testing" + + "github.com/stretchr/testify/assert" +) func TestIsVendor(t *testing.T) { tests := []struct { @@ -33,9 +37,8 @@ func TestIsVendor(t *testing.T) { } for _, tt := range tests { t.Run(tt.path, func(t *testing.T) { - if got := IsVendor(tt.path); got != tt.want { - t.Errorf("IsVendor() = %v, want %v", got, tt.want) - } + got := IsVendor(tt.path) + assert.Equal(t, tt.want, got) }) } } |