1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-09 13:47:11 +02:00

add test for min method

This commit is contained in:
Jesse Duffield 2018-09-12 19:39:36 +10:00
parent 57f6a552d2
commit 3b765e5417

View File

@ -167,3 +167,33 @@ func TestResolvePlaceholderString(t *testing.T) {
assert.EqualValues(t, string(s.expected), ResolvePlaceholderString(s.templateString, s.arguments))
}
}
func TestMin(t *testing.T) {
type scenario struct {
a int
b int
expected int
}
scenarios := []scenario{
{
2,
4,
2,
},
{
2,
1,
1,
},
{
1,
1,
1,
},
}
for _, s := range scenarios {
assert.EqualValues(t, s.expected, Min(s.a, s.b))
}
}