1 #![feature(test)] 2 #![feature(non_ascii_idents)] 3 4 #[cfg(test)] 5 extern crate test; 6 extern crate wana_kana; 7 8 #[cfg(test)] 9 extern crate speculate; 10 11 #[cfg(test)] 12 use speculate::speculate; 13 14 use wana_kana::is_katakana::*; 15 16 speculate! { 17 it "sane defaults" { 18 assert_eq!(is_katakana(""), false); 19 } 20 it "アア is katakana" { assert_eq!(is_katakana("アア"), true); } 21 it "ア is katakana" { assert_eq!(is_katakana("ア"), true); } 22 it "あ is not katakana" { assert_eq!(is_katakana("あ"), false); } 23 it "A is not katakana" { assert_eq!(is_katakana("A"), false); } 24 it "あア is not katakana" { assert_eq!(is_katakana("あア"), false); } 25 it "ignores long dash in katakana" { assert_eq!(is_katakana("ゲーム"), true); } 26 } 27