mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-14 20:07:01 +05:30
feat: begin adding tests for matchers
This commit is contained in:
parent
a112cbefc6
commit
86cb0fde40
2 changed files with 12 additions and 0 deletions
|
@ -1,4 +1,6 @@
|
|||
mod config;
|
||||
#[cfg(test)]
|
||||
mod test;
|
||||
|
||||
use std::error::Error;
|
||||
use std::ops::{Deref, Not};
|
||||
|
|
10
src/test.rs
Normal file
10
src/test.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
use crate::config::{Match, Matcher};
|
||||
|
||||
#[test]
|
||||
fn regex_matcher() {
|
||||
let matcher = Matcher::Regex {
|
||||
pattern: "^https.*",
|
||||
};
|
||||
assert!(matcher.check_match("https://example.com"));
|
||||
assert!(!matcher.check_match("example.com"));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue