Add some tests (#3030)

This commit is contained in:
qwerty287
2023-12-27 10:36:49 +01:00
committed by GitHub
parent 5cb0ae053a
commit e575ffe72d
9 changed files with 117 additions and 2 deletions

View File

@@ -58,3 +58,13 @@ func TestEqualSliceValues(t *testing.T) {
assert.True(t, EqualSliceValues([]bool{true, false, false}, []bool{false, false, true}))
assert.False(t, EqualSliceValues([]bool{true, false, false}, []bool{true, false, true}))
}
func TestSliceToBoolMap(t *testing.T) {
assert.Equal(t, map[string]bool{
"a": true,
"b": true,
"c": true,
}, SliceToBoolMap([]string{"a", "b", "c"}))
assert.Equal(t, map[string]bool{}, SliceToBoolMap([]string{}))
assert.Equal(t, map[string]bool{}, SliceToBoolMap([]string{""}))
}