extern crate safe_vk as vk;
use vk::util::{matchit, Filter};
#[test]
#[rustfmt::skip]
fn strict() {
let filter = &Filter::Strict;
assert!(!matchit("This is a !command123 message", "!command", filter));
assert!(!matchit("This is a command123 message", "!command", filter));
assert!(!matchit("This is a !ComManD123message", "!command", filter));
assert!(!matchit("!coMManD", "!command", filter));
assert!(!matchit(" !command", "!command", filter));
assert!(!matchit("!command ", "!command", filter));
assert!(!matchit("$command", "!command", filter));
assert!(matchit("!command", "!command", filter));
assert!(matchit("$command", "$command", filter));
}
#[test]
#[rustfmt::skip]
fn flexible() {
let filter = &Filter::Flexible;
assert!(!matchit("This is a ! command123 message", "!command", filter));
assert!(!matchit("This is a command1 2 3 message", "!command", filter));
assert!(!matchit("This is a $command 123message", "!command", filter));
assert!(!matchit("This is a %coMMand message", "!command", filter));
assert!(!matchit("This is a !coMManD message ", "!command", filter));
assert!(!matchit("command", "!command", filter));
assert!(matchit(" !command", "!command", filter));
assert!(matchit("!command ", "!command", filter));
assert!(matchit("!command ", "!command", filter));
assert!(!matchit("$command", "!command", filter));
assert!(matchit("!command", "!command", filter));
assert!(matchit("$command", "$command", filter));
}
#[test]
#[rustfmt::skip]
fn loose() {
let filter = &Filter::Sensitive;
assert!(!matchit("This is a ! com m and123 message", "!command", filter));
assert!(!matchit("This is a comm and1 2 3 message", "!command", filter));
assert!(!matchit("This is a $ comm and 123message", "!command", filter));
assert!(!matchit("This is a %c oM Mand message", "!command", filter));
assert!(matchit("This is a !coMManD message ", "!command", filter));
assert!(matchit(" !command", "!command", filter));
assert!(matchit("!command ", "!command", filter));
assert!(matchit("$command", "!command", filter));
assert!(matchit("!command", "!command", filter));
assert!(matchit("command", "command", filter));
}