mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-05-25 09:03:59 +02:00
Fix test now that lexicographic string comparisons are allowed
This commit is contained in:
parent
c0e987979a
commit
185f2b8f74
@ -1288,28 +1288,24 @@ mod tests {
|
|||||||
let result = filter.evaluate(&rtxn, &index).unwrap();
|
let result = filter.evaluate(&rtxn, &index).unwrap();
|
||||||
assert!(result.contains(0));
|
assert!(result.contains(0));
|
||||||
let filter = Filter::from_str("price < inf").unwrap().unwrap();
|
let filter = Filter::from_str("price < inf").unwrap().unwrap();
|
||||||
assert!(matches!(
|
let result = filter.evaluate(&rtxn, &index).unwrap();
|
||||||
filter.evaluate(&rtxn, &index),
|
// this is allowed due to filters with strings
|
||||||
Err(crate::Error::UserError(crate::error::UserError::InvalidFilter(_)))
|
assert!(result.contains(1));
|
||||||
));
|
|
||||||
|
|
||||||
let filter = Filter::from_str("price = NaN").unwrap().unwrap();
|
let filter = Filter::from_str("price = NaN").unwrap().unwrap();
|
||||||
let result = filter.evaluate(&rtxn, &index).unwrap();
|
let result = filter.evaluate(&rtxn, &index).unwrap();
|
||||||
assert!(result.is_empty());
|
assert!(result.is_empty());
|
||||||
let filter = Filter::from_str("price < NaN").unwrap().unwrap();
|
let filter = Filter::from_str("price < NaN").unwrap().unwrap();
|
||||||
assert!(matches!(
|
let result = filter.evaluate(&rtxn, &index).unwrap();
|
||||||
filter.evaluate(&rtxn, &index),
|
assert!(result.contains(1));
|
||||||
Err(crate::Error::UserError(crate::error::UserError::InvalidFilter(_)))
|
|
||||||
));
|
|
||||||
|
|
||||||
let filter = Filter::from_str("price = infinity").unwrap().unwrap();
|
let filter = Filter::from_str("price = infinity").unwrap().unwrap();
|
||||||
let result = filter.evaluate(&rtxn, &index).unwrap();
|
let result = filter.evaluate(&rtxn, &index).unwrap();
|
||||||
assert!(result.contains(2));
|
assert!(result.contains(2));
|
||||||
let filter = Filter::from_str("price < infinity").unwrap().unwrap();
|
let filter = Filter::from_str("price < infinity").unwrap().unwrap();
|
||||||
assert!(matches!(
|
let result = filter.evaluate(&rtxn, &index).unwrap();
|
||||||
filter.evaluate(&rtxn, &index),
|
assert!(result.contains(0));
|
||||||
Err(crate::Error::UserError(crate::error::UserError::InvalidFilter(_)))
|
assert!(result.contains(1));
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user