mirror of
https://github.com/go-gitea/gitea
synced 2025-07-04 17:47:19 +00:00
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
This commit is contained in:
@ -3,7 +3,11 @@
|
||||
|
||||
package util
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestShellEscape(t *testing.T) {
|
||||
tests := []struct {
|
||||
@ -83,9 +87,7 @@ func TestShellEscape(t *testing.T) {
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := ShellEscape(tt.toEscape); got != tt.want {
|
||||
t.Errorf("ShellEscape(%q):\nGot: %s\nWanted: %s", tt.toEscape, got, tt.want)
|
||||
}
|
||||
assert.Equal(t, tt.want, ShellEscape(tt.toEscape))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user