MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / TestMatchForRange

Function TestMatchForRange

internal/utils/utils_test.go:29–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func TestMatchForRange(t *testing.T) {
30 assertions := assert.New(t)
31
32 end, err := utils.MatchForRange("*", "hello", func(key string) bool {
33 return true
34 })
35 assertions.NoError(err, "TestMatchForRange")
36 assertions.False(end, "TestMatchForRange")
37
38 _, err = utils.MatchForRange("[", "hello", func(key string) bool {
39 return true
40 })
41 assertions.Error(err, "TestMatchForRange")
42
43 end, err = utils.MatchForRange("*", "hello", func(key string) bool {
44 return false
45 })
46 assertions.NoError(err, "TestMatchForRange")
47 assertions.True(end, "TestMatchForRange")
48}
49
50func TestEncodeListKeyAndDecodeListKey(t *testing.T) {
51 key := []byte("test_key")

Callers

nothing calls this directly

Calls 2

MatchForRangeFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected