You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
339 B

  1. package common
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestStringInSlice(t *testing.T) {
  7. assert.True(t, StringInSlice("a", []string{"a", "b", "c"}))
  8. assert.False(t, StringInSlice("d", []string{"a", "b", "c"}))
  9. assert.True(t, StringInSlice("", []string{""}))
  10. assert.False(t, StringInSlice("", []string{}))
  11. }