#[derive(Clone)]
pub struct Figures {
pub ellipsis: &'static str,
pub pointer_small: &'static str,
}
impl Default for Figures {
fn default() -> Self {
if cfg!(target_os = "windows") {
Figures {
ellipsis: "...",
pointer_small: "»",
}
} else {
Figures {
ellipsis: "…",
pointer_small: "›",
}
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn figures_all_non_empty() {
let f = Figures::default();
assert!(!f.ellipsis.is_empty());
assert!(!f.pointer_small.is_empty());
}
#[test]
fn figures_clone_equals_original() {
let a = Figures::default();
let b = a.clone();
assert_eq!(a.ellipsis, b.ellipsis);
assert_eq!(a.pointer_small, b.pointer_small);
}
}