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
2 changes: 1 addition & 1 deletion engine/src/list_matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl ListDefinition for AlwaysList {

impl ListMatcher for AlwaysListMatcher {
fn match_value(&self, _: &str, _: &LhsValue<'_>) -> bool {
false
true
}

fn clear(&mut self) {}
Expand Down
16 changes: 16 additions & 0 deletions engine/src/scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,22 @@ fn test_scheme_json_rejects_invalid_identifier() {
assert!(err.to_string().contains("invalid identifier 1invalid"));
}

#[test]
fn test_always_list_matches() {
use crate::{AlwaysList, ExecutionContext};

let mut builder = Scheme! { num: Int };
builder.add_list(Type::Int, AlwaysList {}).unwrap();
let scheme = builder.build();

let filter = scheme.parse("num in $numbers").unwrap().compile();
let mut ctx = ExecutionContext::new(&scheme);
ctx.set_field_value(scheme.get_field("num").unwrap(), 42)
.unwrap();

assert_eq!(filter.execute(&ctx), Ok(true));
}

#[test]
fn test_nil_not_equal_behavior_true() {
use crate::{Array, ExecutionContext, Map};
Expand Down