diff options
Diffstat (limited to 'strings/strings_test.go')
| -rw-r--r-- | strings/strings_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/strings/strings_test.go b/strings/strings_test.go index ad32e3f6..f2afb2f5 100644 --- a/strings/strings_test.go +++ b/strings/strings_test.go @@ -25,3 +25,17 @@ func TestTrunc(t *testing.T) { assert.Equal(t, "hello, world", Trunc(42, "hello, world")) assert.Equal(t, "hello, world", Trunc(-1, "hello, world")) } + +func TestSort(t *testing.T) { + in := []string{} + expected := []string{} + assert.EqualValues(t, expected, Sort(in)) + + in = []string{"c", "a", "b"} + expected = []string{"a", "b", "c"} + assert.EqualValues(t, expected, Sort(in)) + + in = []string{"42", "45", "18"} + expected = []string{"18", "42", "45"} + assert.EqualValues(t, expected, Sort(in)) +} |
