* migrate test to use testify

* use require.NotEmpty
Этот коммит содержится в:
Chanwit Piromplad
2019-11-12 21:15:32 +07:00
коммит произвёл Ben Schumacher
родитель bf693b6a0c
Коммит 0c8b580458
2 изменённых файлов: 11 добавлений и 24 удалений

Просмотреть файл

@@ -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")
}