From 5b0a636e02b799de1f992c6f379874f44cb2b6c9 Mon Sep 17 00:00:00 2001 From: bandl <1658002533@qq.com> Date: Wed, 20 Oct 2021 21:42:58 +0800 Subject: [PATCH] test(stringx): test Getrange --- pkg/structure/stringx/string_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/structure/stringx/string_test.go b/pkg/structure/stringx/string_test.go index 978028b..d9e53cb 100644 --- a/pkg/structure/stringx/string_test.go +++ b/pkg/structure/stringx/string_test.go @@ -1,9 +1,10 @@ package stringx import ( + "testing" + "gitee.com/timedb/wheatCache/pkg/structure" "github.com/stretchr/testify/require" - "testing" ) func TestStringSingle_Set(t *testing.T) { @@ -80,3 +81,11 @@ func TestStringSingle_Getbit(t *testing.T) { require.NoError(t, err) 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) +}