Skip to content

Commit

Permalink
Fix tests after removing clones in handle_value
Browse files Browse the repository at this point in the history
  • Loading branch information
esensar committed Jan 8, 2025
1 parent 8524b6a commit 7b4712c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/enrichment_tables/memory/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ mod tests {
#[test]
fn finds_row() {
let mut memory = Memory::new(Default::default());
memory.handle_value(&ObjectMap::from([("test_key".into(), Value::from(5))]));
memory.handle_value(ObjectMap::from([("test_key".into(), Value::from(5))]));

let condition = Condition::Equals {
field: "key",
Expand Down Expand Up @@ -393,7 +393,7 @@ mod tests {
);

// Force scan
memory.handle_value(&ObjectMap::default());
memory.handle_value(ObjectMap::default());

// The value is not present anymore
assert!(memory
Expand All @@ -410,7 +410,7 @@ mod tests {
c.ttl = ttl;
c.flush_interval = 10;
}));
memory.handle_value(&ObjectMap::from([("test_key".into(), Value::from(5))]));
memory.handle_value(ObjectMap::from([("test_key".into(), Value::from(5))]));

let condition = Condition::Equals {
field: "key",
Expand Down Expand Up @@ -453,7 +453,7 @@ mod tests {
memory.find_table_row(Case::Sensitive, &[condition.clone()], None, None)
);

memory.handle_value(&ObjectMap::from([("test_key".into(), Value::from(5))]));
memory.handle_value(ObjectMap::from([("test_key".into(), Value::from(5))]));

assert_eq!(
Ok(ObjectMap::from([
Expand All @@ -470,7 +470,7 @@ mod tests {
let mut memory = Memory::new(build_memory_config(|c| {
c.max_byte_size = 1;
}));
memory.handle_value(&ObjectMap::from([("test_key".into(), Value::from(5))]));
memory.handle_value(ObjectMap::from([("test_key".into(), Value::from(5))]));

let condition = Condition::Equals {
field: "key",
Expand All @@ -491,8 +491,8 @@ mod tests {
c.ttl = ttl;
c.max_byte_size = 150;
}));
memory.handle_value(&ObjectMap::from([("test_key".into(), Value::from(5))]));
memory.handle_value(&ObjectMap::from([("rejected_key".into(), Value::from(5))]));
memory.handle_value(ObjectMap::from([("test_key".into(), Value::from(5))]));
memory.handle_value(ObjectMap::from([("rejected_key".into(), Value::from(5))]));

assert_eq!(
Ok(ObjectMap::from([
Expand Down

0 comments on commit 7b4712c

Please sign in to comment.