Skip to content

Commit

Permalink
fix(filter): Allow underscore in placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed May 29, 2024
1 parent 0816994 commit 862a740
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/snapbox/src/filter/redactions.rs
Original file line number Diff line number Diff line change
@@ -331,7 +331,7 @@ fn validate_placeholder(placeholder: &'static str) -> crate::assert::Result<&'st
}

if placeholder[1..(placeholder.len() - 1)]
.find(|c: char| !c.is_ascii_uppercase())
.find(|c: char| !c.is_ascii_uppercase() && c != '_')
.is_some()
{
return Err(format!("Key `{}` can only be A-Z but ", placeholder).into());
@@ -350,6 +350,7 @@ mod test {
("[HELLO", false),
("HELLO]", false),
("[HELLO]", true),
("[HELLO_WORLD]", true),
("[hello]", false),
("[HE O]", false),
];

0 comments on commit 862a740

Please sign in to comment.