From 5a76b579528bb90b5aff388f8aa68594c22a03c3 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 19 Sep 2018 19:31:29 +1000 Subject: one more spec to increase coverage --- pkg/utils/utils_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'pkg/utils') 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)) + } +} -- cgit v1.2.3