diff --git a/internal/approval/glob_test_helpers_test.go b/internal/approval/glob_test_helpers_test.go new file mode 100644 index 0000000..8d445ee --- /dev/null +++ b/internal/approval/glob_test_helpers_test.go @@ -0,0 +1,16 @@ +package approval + +import "regexp" + +func globCacheLen() int { + globCache.RLock() + n := len(globCache.m) + globCache.RUnlock() + return n +} + +func resetGlobCache() { + globCache.Lock() + globCache.m = make(map[string]*regexp.Regexp) + globCache.Unlock() +} diff --git a/internal/approval/manager.go b/internal/approval/manager.go index 7ef5b26..2991471 100644 --- a/internal/approval/manager.go +++ b/internal/approval/manager.go @@ -499,21 +499,6 @@ func globToRegexp(pattern string) (*regexp.Regexp, error) { return re, nil } -// globCacheLen returns the current number of entries in the glob regexp cache. -// Exported for testing only. -func globCacheLen() int { - globCache.RLock() - n := len(globCache.m) - globCache.RUnlock() - return n -} - -// resetGlobCache clears the glob regexp cache. Exported for testing only. -func resetGlobCache() { - globCache.Lock() - globCache.m = make(map[string]*regexp.Regexp) - globCache.Unlock() -} // judgeResultToLLMResponse converts a JudgeResult to a types.LLMResponse. func judgeResultToLLMResponse(r judge.JudgeResult, err error) *types.LLMResponse {