feat: Add comprehensive tests for contentPattern and glob pattern matching

- Implemented final verification tests for contentPattern to validate behavior with empty strings, dangerous patterns, and normal patterns.
- Created glob pattern matching tests to verify regex conversion and matching functionality.
- Developed infinite loop risk tests using Worker threads to isolate potential blocking operations.
- Introduced optimized contentPattern tests to validate improvements in the findMatches function.
- Added verification tests to assess the effectiveness of contentPattern optimizations.
- Conducted safety tests for contentPattern to identify edge cases and potential vulnerabilities.
- Implemented unrestricted loop tests to analyze infinite loop risks without match limits.
- Developed tests for zero-width pattern detection logic to ensure proper handling of dangerous regex patterns.
This commit is contained in:
catlog22
2026-02-09 11:13:01 +08:00
parent dfe153778c
commit 964292ebdb
62 changed files with 7588 additions and 374 deletions

View File

@@ -0,0 +1,41 @@
// ========================================
// Team Store
// ========================================
// UI state for team execution visualization
import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';
import type { TeamMessageFilter } from '@/types/team';
interface TeamStore {
selectedTeam: string | null;
autoRefresh: boolean;
messageFilter: TeamMessageFilter;
timelineExpanded: boolean;
setSelectedTeam: (name: string | null) => void;
toggleAutoRefresh: () => void;
setMessageFilter: (filter: Partial<TeamMessageFilter>) => void;
clearMessageFilter: () => void;
setTimelineExpanded: (expanded: boolean) => void;
}
export const useTeamStore = create<TeamStore>()(
devtools(
persist(
(set) => ({
selectedTeam: null,
autoRefresh: true,
messageFilter: {},
timelineExpanded: true,
setSelectedTeam: (name) => set({ selectedTeam: name }),
toggleAutoRefresh: () => set((s) => ({ autoRefresh: !s.autoRefresh })),
setMessageFilter: (filter) =>
set((s) => ({ messageFilter: { ...s.messageFilter, ...filter } })),
clearMessageFilter: () => set({ messageFilter: {} }),
setTimelineExpanded: (expanded) => set({ timelineExpanded: expanded }),
}),
{ name: 'ccw-team-store' }
),
{ name: 'TeamStore' }
)
);