@@ -7,24 +7,24 @@ import (
77
88func TestRegexCache(t *testing.T) {
99 cache := newRegexCache()
10−
10+
1111 // Test basic caching
1212 pattern := "test.*pattern"
1313 regex1, err := cache.get(pattern)
1414 if err != nil {
1515 t.Fatalf("Failed to compile regex: %v", err)
1616 }
17−
17+
1818 regex2, err := cache.get(pattern)
1919 if err != nil {
2020 t.Fatalf("Failed to get cached regex: %v", err)
2121 }
22−
22+
2323 // Should be the same instance (cached)
2424 if regex1 != regex2 {
2525 t.Error("Expected cached regex to be the same instance")
2626 }
27−
27+
2828 // Test that it actually works
2929 if !regex1.MatchString("test123pattern") {
3030 t.Error("Regex should match test string")
@@ -34,13 +34,13 @@ func TestRegexCache(t *testing.T) {
3434func TestGlobToRegexCaching(t *testing.T) {
3535 // Test that globToRegex uses pre-compiled regex
3636 pattern1 := globToRegex("*.{js,ts}")
37−
37+
3838 // Should not panic and should work correctly
3939 regex1, err := regexp.Compile(pattern1)
4040 if err != nil {
4141 t.Fatalf("Failed to compile glob regex: %v", err)
4242 }
43−
43+
4444 if !regex1.MatchString("test.js") {
4545 t.Error("Glob regex should match .js files")
4646 }
@@ -56,7 +56,7 @@ func TestGlobToRegexCaching(t *testing.T) {
5656func BenchmarkRegexCacheVsCompile(b *testing.B) {
5757 cache := newRegexCache()
5858 pattern := "test.*pattern.*[0-9]+"
59−
59+
6060 b.Run("WithCache", func(b *testing.B) {
6161 for b.Loop() {
6262 _, err := cache.get(pattern)
@@ -65,7 +65,7 @@ func BenchmarkRegexCacheVsCompile(b *testing.B) {
6565 }
6666 }
6767 })
68−
68+
6969 b.Run("WithoutCache", func(b *testing.B) {
7070 for b.Loop() {
7171 _, err := regexp.Compile(pattern)
@@ -74,4 +74,4 @@ func BenchmarkRegexCacheVsCompile(b *testing.B) {
7474 }
7575 }
7676 })
77−}
77+}