use phf::phf_map;
pub static FRACTIONS: phf::Map<&'static str, (&'static str, &'static str)> = phf_map! {
"1/2" => ("\u{00BD}", "fraction one half"), "1/4" => ("\u{00BC}", "fraction one quarter"), "3/4" => ("\u{00BE}", "fraction three quarters"), "1/3" => ("\u{2153}", "fraction one third"), "2/3" => ("\u{2154}", "fraction two thirds"), "1/5" => ("\u{2155}", "fraction one fifth"), "2/5" => ("\u{2156}", "fraction two fifths"), "3/5" => ("\u{2157}", "fraction three fifths"), "4/5" => ("\u{2158}", "fraction four fifths"), "1/6" => ("\u{2159}", "fraction one sixth"), "5/6" => ("\u{215A}", "fraction five sixths"), "1/8" => ("\u{215B}", "fraction one eighth"), "3/8" => ("\u{215C}", "fraction three eighths"), "5/8" => ("\u{215D}", "fraction five eighths"), "7/8" => ("\u{215E}", "fraction seven eighths"), };
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_common_fractions() {
assert_eq!(
FRACTIONS.get("1/2"),
Some(&("\u{00BD}", "fraction one half"))
);
assert_eq!(
FRACTIONS.get("1/4"),
Some(&("\u{00BC}", "fraction one quarter"))
);
assert_eq!(
FRACTIONS.get("3/4"),
Some(&("\u{00BE}", "fraction three quarters"))
);
}
#[test]
fn test_thirds_and_fifths() {
assert_eq!(
FRACTIONS.get("1/3"),
Some(&("\u{2153}", "fraction one third"))
);
assert_eq!(
FRACTIONS.get("2/5"),
Some(&("\u{2156}", "fraction two fifths"))
);
}
}