Skip to content

Commit

Permalink
Add replace_all_modifier_should_be_case_sensitive test
Browse files Browse the repository at this point in the history
  • Loading branch information
ufoscout committed Oct 19, 2020
1 parent 49955b9 commit b4fe438
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions engine/matcher/src/matcher/modifier/replace.rs
Expand Up @@ -57,6 +57,24 @@ mod test {
}
}

#[test]
fn replace_all_modifier_should_be_case_sensitive() {
let find_text = "TexT";
let replace_text = "new_TexT";

{
let mut input = Value::Text("text".to_owned());
replace_all("", &mut input, find_text, replace_text).unwrap();
assert_eq!(Value::Text("text".to_owned()), input);
}

{
let mut input = Value::Text("TexT".to_owned());
replace_all("", &mut input, find_text, replace_text).unwrap();
assert_eq!(Value::Text("new_TexT".to_owned()), input);
}
}

#[test]
fn replace_all_modifier_should_fail_if_value_not_a_string() {
let find_text = "text";
Expand Down

0 comments on commit b4fe438

Please sign in to comment.