mirror of
https://github.com/YGGverse/plurify.git
synced 2026-03-31 09:05:40 +00:00
24 lines
643 B
Rust
24 lines
643 B
Rust
#[cfg(test)]
|
|
use plurify::*;
|
|
|
|
#[test]
|
|
fn test() {
|
|
let en = &["cat", "cats", "cats"];
|
|
let uk = &["кіт", "кота", "котів"];
|
|
|
|
assert_eq!(plurify(1, en), "cat");
|
|
assert_eq!(plurify(2, en), "cats");
|
|
assert_eq!(plurify(5, en), "cats");
|
|
|
|
assert_eq!(plurify(1, uk), "кіт");
|
|
assert_eq!(plurify(2, uk), "кота");
|
|
assert_eq!(plurify(5, uk), "котів");
|
|
|
|
assert_eq!(1.plurify(en), "cat");
|
|
assert_eq!(2.plurify(en), "cats");
|
|
assert_eq!(5.plurify(en), "cats");
|
|
|
|
assert_eq!(1.plurify(uk), "кіт");
|
|
assert_eq!(2.plurify(uk), "кота");
|
|
assert_eq!(5.plurify(uk), "котів");
|
|
}
|