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
289 B

  1. package kv
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestIntInSlice(t *testing.T) {
  7. assert.True(t, intInSlice(1, []int{1, 2, 3}))
  8. assert.False(t, intInSlice(4, []int{1, 2, 3}))
  9. assert.True(t, intInSlice(0, []int{0}))
  10. assert.False(t, intInSlice(0, []int{}))
  11. }