Add support for sort by boolean

This commit is contained in:
Tom
2020-05-02 12:57:34 +03:00
committed by GitHub
parent dd31e80007
commit 04b1a6d997
2 changed files with 13 additions and 0 deletions

View File

@@ -218,6 +218,9 @@ func TestSort(t *testing.T) {
map[interface{}]interface{}{"Title": "Foo", "Weight": 10},
},
},
// test boolean values
{[]bool{false, true, false}, "value", "asc", []bool{false, false, true}},
{[]bool{false, true, false}, "value", "desc", []bool{true, false, false}},
// test error cases
{(*[]TstX)(nil), nil, "asc", false},
{TstX{A: "a", B: "b"}, nil, "asc", false},