Skip to content

Commit

Permalink
test(term): add matcher test
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Apr 27, 2024
1 parent 4cc525f commit f1dc956
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions crates/synd_term/src/matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,25 @@ impl fmt::Debug for Matcher {
.finish_non_exhaustive()
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn should_match() {
let mut m = Matcher::new();

let cases = vec![
("rustsec", "rustsec"),
("rustsec", "RUSTSEC"),
("rustsec", "RustSec"),
("this week in rust", "This Week in Rust"),
];

for case in cases {
m.update_needle(case.0);
assert!(m.r#match(case.1));
}
}
}

0 comments on commit f1dc956

Please sign in to comment.