use doido_core::inflector::Inflections;
#[test]
fn test_plural_adds_rule() {
let mut i = Inflections::new();
i.plural(r"(?i)^(cat)$", "cats");
assert_eq!(i.pluralize("cat"), "cats");
}
#[test]
fn test_singular_adds_rule() {
let mut i = Inflections::new();
i.singular(r"(?i)^(cats)$", "cat");
assert_eq!(i.singularize("cats"), "cat");
}
#[test]
fn test_irregular_stores_lowercase() {
let mut i = Inflections::new();
i.irregular("Person", "People");
assert_eq!(i.pluralize("person"), "people");
assert_eq!(i.singularize("people"), "person");
}
#[test]
fn test_uncountable_stores_lowercase() {
let mut i = Inflections::new();
i.uncountable("Sheep");
assert_eq!(i.pluralize("sheep"), "sheep");
assert_eq!(i.singularize("sheep"), "sheep");
}
#[test]
fn test_acronym_stores_uppercase() {
let mut i = Inflections::new();
i.acronym("api");
assert_eq!(i.camelize("api_client"), "APIClient");
}