diff --git a/docs/.vuepress/public/presets/toml/plain-text-symbols.toml b/docs/.vuepress/public/presets/toml/plain-text-symbols.toml index 66eca654..e9ee0b95 100644 --- a/docs/.vuepress/public/presets/toml/plain-text-symbols.toml +++ b/docs/.vuepress/public/presets/toml/plain-text-symbols.toml @@ -180,6 +180,9 @@ symbol = "scala " [spack] symbol = "spack " +[status] +symbol = "[x](bold red) " + [sudo] symbol = "sudo " diff --git a/src/modules/status.rs b/src/modules/status.rs index 8d17ea40..4c33896c 100644 --- a/src/modules/status.rs +++ b/src/modules/status.rs @@ -337,6 +337,27 @@ mod tests { } } + #[test] + fn failure_plaintext_status() { + let exit_values = [1, 2, 130]; + + for status in &exit_values { + let expected = Some(format!( + "{} ", + Color::Red.bold().paint(format!("x {status}")) + )); + let actual = ModuleRenderer::new("status") + .config(toml::toml! { + [status] + symbol = "[x](bold red) " + disabled = false + }) + .status(*status) + .collect(); + assert_eq!(expected, actual); + } + } + #[test] fn failure_hex_status() { let exit_values = [1, 2, 130, -2_147_467_260, 2_147_500_036];