pub(crate) fn get(name: &str) -> Option<char> {
AMS_GLYPH_NAMES
.iter()
.find(|(entry, _)| *entry == name)
.map(|(_, value)| *value)
}
static AMS_GLYPH_NAMES: [(&str, char); 10] = [
("squaredot", '\u{22A1}'),
("square", '\u{25A1}'),
("dblarrowup", '\u{21C8}'),
("dblarrowdwn", '\u{21CA}'),
("triangle", '\u{25B3}'),
("circlecopyrt", '\u{20DD}'),
("negationslash", '\u{0338}'),
("angbracketleft", '\u{27E8}'),
("angbracketright", '\u{27E9}'),
("visiblespace", '\u{2423}'),
];
#[cfg(test)]
mod tests {
use super::get;
#[test]
fn the_phase_two_row_reads_as_the_enclosing_circle() {
assert_eq!(get("circlecopyrt"), Some('\u{20DD}'));
}
#[test]
fn the_phase_three_row_reads_as_the_long_solidus_overlay() {
assert_eq!(get("negationslash"), Some('\u{0338}'));
}
#[test]
fn the_phase_four_rows_read_as_the_mathematical_angle_brackets() {
assert_eq!(get("angbracketleft"), Some('\u{27E8}'));
assert_eq!(get("angbracketright"), Some('\u{27E9}'));
}
#[test]
fn the_phase_five_row_reads_as_the_open_box() {
assert_eq!(get("visiblespace"), Some('\u{2423}'));
}
#[test]
fn the_agl_copyright_name_is_not_in_this_table() {
assert_eq!(get("copyright"), None);
}
}