Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-08-10 22:05:17 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-08-12 14:26:32 +0300
commit9e571827055dedb46b78c5db3d17d6913f14870b (patch)
treef5f0108afe0c9385ff6dc27664943d9f719f57ad /compare
parent6027ee11082d0b9d72de1d4d1980a702be294ad2 (diff)
tests: Convert from testify to quicktest
Diffstat (limited to 'compare')
-rw-r--r--compare/compare_strings_test.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/compare/compare_strings_test.go b/compare/compare_strings_test.go
index 82132cf11..db286c2c5 100644
--- a/compare/compare_strings_test.go
+++ b/compare/compare_strings_test.go
@@ -14,17 +14,16 @@
package compare
import (
- "fmt"
"sort"
"strings"
"testing"
- "github.com/stretchr/testify/require"
+ qt "github.com/frankban/quicktest"
)
func TestCompare(t *testing.T) {
- assert := require.New(t)
- for i, test := range []struct {
+ c := qt.New(t)
+ for _, test := range []struct {
a string
b string
}{
@@ -47,13 +46,13 @@ func TestCompare(t *testing.T) {
expect := strings.Compare(strings.ToLower(test.a), strings.ToLower(test.b))
got := compareFold(test.a, test.b)
- assert.Equal(expect, got, fmt.Sprintf("test %d: %d", i, expect))
+ c.Assert(got, qt.Equals, expect)
}
}
func TestLexicographicSort(t *testing.T) {
- assert := require.New(t)
+ c := qt.New(t)
s := []string{"b", "Bz", "ba", "A", "Ba", "ba"}
@@ -61,6 +60,6 @@ func TestLexicographicSort(t *testing.T) {
return LessStrings(s[i], s[j])
})
- assert.Equal([]string{"A", "b", "Ba", "ba", "ba", "Bz"}, s)
+ c.Assert(s, qt.DeepEquals, []string{"A", "b", "Ba", "ba", "ba", "Bz"})
}