Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Rule Engine πŸš€


[![Go Version](https://img.shields.io/badge/Go-1.24+-blue.svg)](https://golang.org)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Tests](https://img.shields.io/badge/Tests-All%20Passing-brightgreen.svg)](#)
Expand Down
14 changes: 6 additions & 8 deletions race_condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ func TestEngine_RaceCondition_DifferentQueries(t *testing.T) {
if errorCount > 0 {
t.Errorf("❌ RACE CONDITION DETECTED: %d evaluations returned incorrect results", errorCount)
} else {
t.Logf("βœ… No race conditions detected in %d concurrent mixed query evaluations", numGoroutines*iterationsPerGoroutine)
t.Logf(
"βœ… No race conditions detected in %d concurrent mixed query evaluations",
numGoroutines*iterationsPerGoroutine,
)
}

require.Equal(t, 0, errorCount, "All evaluations should return correct results")
Expand Down Expand Up @@ -252,19 +255,14 @@ func TestEngine_RaceCondition_SameQueryDifferentContexts(t *testing.T) {
errorCount++
}

require.Positive(
t,
errorCount,
"❌ RACE CONDITION DETECTED: %d evaluations returned incorrect results",
errorCount,
require.Equal(t, 0, errorCount,
"❌ RACE CONDITION DETECTED: %d evaluations returned incorrect results", errorCount,
)

t.Logf(
"βœ… No race conditions detected in %d concurrent evaluations with different contexts",
numGoroutines*iterationsPerGoroutine,
)

require.Equal(t, 0, errorCount, "All evaluations should return correct results")
}

// Helper functions
Expand Down
11 changes: 8 additions & 3 deletions test/additional_edge_cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ var AdditionalEdgeCaseTests = []Case{
}, true},

// Performance edge cases
{"very_long_string", `text co "needle"`, rule.D{
"text": "This is a very long string that contains the word needle somewhere in the middle of all this text that goes on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on",
}, true},
{
"very_long_string",
`text co "needle"`,
rule.D{
"text": "This is a very long string that contains the word needle somewhere in the middle of all this text that goes on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on",
},
true,
},

// Empty string edge cases
{"empty_string_contains_empty", `x co ""`, rule.D{"x": "hello"}, true},
Expand Down
1 change: 1 addition & 0 deletions test/edge_case_fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ var ExtremeValueTests = []Case{
for i := range 1000 {
arr[i] = i
}

return arr
}(),
}, true},
Expand Down
Loading