summaryrefslogtreecommitdiff
path: root/strings/strings_test.go
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2018-07-18 21:35:33 -0400
committerDave Henderson <dhenderson@gmail.com>2018-07-18 21:35:33 -0400
commitc56dc624778fc3f9695a712c02c8b306da0c88b2 (patch)
treead4c9ac281511680014a465654ace05f3759ba78 /strings/strings_test.go
parent458c19fba9b7183bf60504af6005c7fc82fc3815 (diff)
Adding new strings.Sort function
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'strings/strings_test.go')
-rw-r--r--strings/strings_test.go14
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))
+}