use std::collections::HashMap;
pub struct ZshPromptRenderer;
impl ZshPromptRenderer {
#[allow(non_upper_case_globals)]
pub const escape_hl_start: &'static str = "%{";
#[allow(non_upper_case_globals)]
pub const escape_hl_end: &'static str = "%}";
pub fn character_translations() -> HashMap<char, &'static str> {
let mut t: HashMap<char, &'static str> = HashMap::new();
t.insert('%', "%%");
t
}
}
#[allow(non_camel_case_types)]
pub type renderer = ZshPromptRenderer;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn zsh_escape_markers_use_prompt_subst_safe_form() {
assert_eq!(ZshPromptRenderer::escape_hl_start, "%{");
assert_eq!(ZshPromptRenderer::escape_hl_end, "%}");
}
#[test]
fn percent_is_doubled_in_translations() {
let t = ZshPromptRenderer::character_translations();
assert_eq!(t.get(&'%'), Some(&"%%"));
}
}