Lines
100 %
Functions
Branches
mod api;
mod cite;
mod gallery;
mod image;
mod indicator;
mod parsoid;
pub(crate) mod test_client;
use super::*;
#[test]
fn test_clean_link() {
assert_eq!(
clean_link("./Template:Foo_bar"),
"Template:Foo bar".to_string()
);
assert_eq!(clean_link("ifeq"), "ifeq".to_string());
}
fn test_full_link() {
full_link("Template:Foo bar"),
"./Template:Foo_bar".to_string()
// Yes, this is not what you'd expect. It's not a direct reversal of clean_link()
assert_eq!(full_link("ifeq"), "./ifeq".to_string());
fn test_attribute_contains_word() {
assert!(attribute_contains_word("mw:Foo", "mw:Foo")); // yes
assert!(!attribute_contains_word("mw:Foo", "mw:Bar")); // no
assert!(attribute_contains_word("mw:Foo mw:Bar", "mw:Bar")); // yes
assert!(!attribute_contains_word("mw:Foo/Bar", "mw:Foo")); // no