forked from p93542168/wheat-cache
test(stringx): test Getrange
This commit is contained in:
parent
fe096c9054
commit
5b0a636e02
|
@ -1,9 +1,10 @@
|
||||||
package stringx
|
package stringx
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
"gitee.com/timedb/wheatCache/pkg/structure"
|
"gitee.com/timedb/wheatCache/pkg/structure"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"testing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestStringSingle_Set(t *testing.T) {
|
func TestStringSingle_Set(t *testing.T) {
|
||||||
|
@ -80,3 +81,11 @@ func TestStringSingle_Getbit(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, res, false)
|
require.Equal(t, res, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestStringSingle_Getrange(t *testing.T) {
|
||||||
|
s := NewStringSingle()
|
||||||
|
s.Set("abcdefg")
|
||||||
|
k, err := s.Getrange(0, 3)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Equal(t, "abc", k)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue