summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-09-19 19:31:29 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-09-19 19:31:29 +1000
commit5a76b579528bb90b5aff388f8aa68594c22a03c3 (patch)
tree922550b1d5d163969d223998a7b6de135c0a5fad
parent64f0eeb42e8c19251f0ca823e43c62468066474c (diff)
one more spec to increase coverage
-rw-r--r--pkg/utils/utils_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkg/utils/utils_test.go b/pkg/utils/utils_test.go
index 76a9f8b95..918031512 100644
--- a/pkg/utils/utils_test.go
+++ b/pkg/utils/utils_test.go
@@ -346,3 +346,33 @@ func TestGetPadWidths(t *testing.T) {
assert.EqualValues(t, s.expected, getPadWidths(s.stringArrays))
}
}
+
+func TestMin(t *testing.T) {
+ type scenario struct {
+ a int
+ b int
+ expected int
+ }
+
+ scenarios := []scenario{
+ {
+ 1,
+ 1,
+ 1,
+ },
+ {
+ 1,
+ 2,
+ 1,
+ },
+ {
+ 2,
+ 1,
+ 1,
+ },
+ }
+
+ for _, s := range scenarios {
+ assert.EqualValues(t, s.expected, Min(s.a, s.b))
+ }
+}