mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 04:01:55 +00:00
IntInSlice and StringInSlice functions
Refs https://github.com/tendermint/tendermint/pull/835
This commit is contained in:
14
common/int_test.go
Normal file
14
common/int_test.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestIntInSlice(t *testing.T) {
|
||||
assert.True(t, IntInSlice(1, []int{1, 2, 3}))
|
||||
assert.False(t, IntInSlice(4, []int{1, 2, 3}))
|
||||
assert.True(t, IntInSlice(0, []int{0}))
|
||||
assert.False(t, IntInSlice(0, []int{}))
|
||||
}
|
Reference in New Issue
Block a user