diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-19 19:31:29 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-19 19:31:29 +1000 |
commit | 5a76b579528bb90b5aff388f8aa68594c22a03c3 (patch) | |
tree | 922550b1d5d163969d223998a7b6de135c0a5fad /pkg/utils/utils_test.go | |
parent | 64f0eeb42e8c19251f0ca823e43c62468066474c (diff) |
one more spec to increase coverage
Diffstat (limited to 'pkg/utils/utils_test.go')
-rw-r--r-- | pkg/utils/utils_test.go | 30 |
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)) + } +} |