Skip to content

Commit

Permalink
Fix failing data test test-case-boolean-one-of-matches.json
Browse files Browse the repository at this point in the history
  • Loading branch information
leoromanovsky committed Jun 28, 2024
1 parent ed283d0 commit 179402c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions eppo_core/src/ufc/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ impl ConditionOperator {
match self {
Self::Matches | Self::NotMatches => {
let s = match attribute {
Some(AttributeValue::String(s)) => s,
Some(AttributeValue::String(s)) => s.clone(),
Some(AttributeValue::Boolean(b)) => b.to_string(),
_ => return None,
};
let regex = match condition_value {
ConditionValue::Single(Value::String(s)) => Regex::new(s).ok()?,
_ => return None,
};
let matches = regex.is_match(s);
let matches = regex.is_match(&s);
Some(if matches!(self, Self::Matches) {
matches
} else {
Expand Down

0 comments on commit 179402c

Please sign in to comment.