Skip to content

Commit d09c099

Browse files
Test with invalid regex.
1 parent 7859430 commit d09c099

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fastcache_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ func TestCacheKeys(t *testing.T) {
225225
t.Fatalf("failed to retrievs keys by pattern: \"%s\"", tt.Pattern)
226226
}
227227
}
228+
229+
result, err := c.Keys("*")
230+
if result != nil {
231+
t.Fatal("expected no matches")
232+
}
233+
if err == nil {
234+
t.Fatal("expected regex error")
235+
}
228236
}
229237

230238
func testCacheGetSet(c *Cache, itemsCount int) error {

0 commit comments

Comments
 (0)