clean warnings and add tests
This commit is contained in:
19
tests/test_links_to_rewrite.rs
Normal file
19
tests/test_links_to_rewrite.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use mini_admin_bot::rewrite_links;
|
||||
|
||||
mod mocks;
|
||||
#[test]
|
||||
pub fn test_contain_links() {
|
||||
assert_eq!(
|
||||
false,
|
||||
rewrite_links::check_contain_links::contain_links(
|
||||
mocks::teloxide_mocks::generate_msg_mock("hola")
|
||||
)
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
true,
|
||||
rewrite_links::check_contain_links::contain_links(
|
||||
mocks::teloxide_mocks::generate_msg_mock("https://x.com")
|
||||
)
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user