migrate test to use testify (#12894)
* migrate test to use testify * use require.NotEmpty
Этот коммит содержится в:
коммит произвёл
Ben Schumacher
родитель
bf693b6a0c
Коммит
0c8b580458
@@ -5,6 +5,8 @@ package utils
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestUrlEncode(t *testing.T) {
|
||||
@@ -12,24 +14,15 @@ func TestUrlEncode(t *testing.T) {
|
||||
toEncode := "testing 1 2 3"
|
||||
encoded := UrlEncode(toEncode)
|
||||
|
||||
if encoded != "testing%201%202%203" {
|
||||
t.Log(encoded)
|
||||
t.Fatal("should be equal")
|
||||
}
|
||||
require.Equal(t, encoded, "testing%201%202%203")
|
||||
|
||||
toEncode = "testing123"
|
||||
encoded = UrlEncode(toEncode)
|
||||
|
||||
if encoded != "testing123" {
|
||||
t.Log(encoded)
|
||||
t.Fatal("should be equal")
|
||||
}
|
||||
require.Equal(t, encoded, "testing123")
|
||||
|
||||
toEncode = "testing$#~123"
|
||||
encoded = UrlEncode(toEncode)
|
||||
|
||||
if encoded != "testing%24%23~123" {
|
||||
t.Log(encoded)
|
||||
t.Fatal("should be equal")
|
||||
}
|
||||
require.Equal(t, encoded, "testing%24%23~123")
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user