mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-02 09:21:21 +08:00
✨ feat(redis): 新增 Key 精确搜索模式
- 增加 Redis Key 模糊/精确搜索切换 - 精确模式不再追加通配符并保留大小写敏感匹配 - 转义 Redis glob 特殊字符避免误匹配 - 补充搜索模式回归测试
This commit is contained in:
@@ -31,6 +31,20 @@ describe('normalizeRedisSearchInput', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('uses literal key pattern without fuzzy wildcards in exact mode', () => {
|
||||
expect(normalizeRedisSearchInput('Order:1001', 'exact')).toEqual({
|
||||
keyword: 'Order:1001',
|
||||
pattern: 'Order:1001',
|
||||
});
|
||||
});
|
||||
|
||||
it('escapes redis glob special characters in exact mode without adding wildcards', () => {
|
||||
expect(normalizeRedisSearchInput('user:*:[id]?\\raw', 'exact')).toEqual({
|
||||
keyword: 'user:*:[id]?\\raw',
|
||||
pattern: 'user:\\*:\\[id\\]\\?\\\\raw',
|
||||
});
|
||||
});
|
||||
|
||||
it('marks empty draft changes for immediate reset search', () => {
|
||||
expect(normalizeRedisSearchDraftChange('')).toEqual({
|
||||
keyword: '',
|
||||
|
||||
Reference in New Issue
Block a user