Skip to content

Commit 9344f20

Browse files
committed
fix(filter): Take redactions into account for Array elides
Fixes #352
1 parent b71f8d0 commit 9344f20

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

crates/snapbox/src/filter/pattern.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,11 @@ fn normalize_array_to_redactions(
473473
input_index = input.len();
474474
break;
475475
};
476-
let Some(index_offset) = input[input_index..]
477-
.iter()
478-
.position(|next_input_elem| next_input_elem == *next_pattern_elem)
479-
else {
476+
let Some(index_offset) = input[input_index..].iter().position(|next_input_elem| {
477+
let mut next_input_elem = next_input_elem.clone();
478+
normalize_value_to_redactions(&mut next_input_elem, next_pattern_elem, redactions);
479+
next_input_elem == **next_pattern_elem
480+
}) else {
480481
// Give up as we can't find where the elide ends
481482
break;
482483
};

0 commit comments

Comments
 (0)