mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-12-01 01:04:00 +00:00
docs(preset): Plaintext status added (#4775)
* Plaintext status added * One test case
This commit is contained in:
parent
e0590f1669
commit
8a8e09dd50
@ -180,6 +180,9 @@ symbol = "scala "
|
|||||||
[spack]
|
[spack]
|
||||||
symbol = "spack "
|
symbol = "spack "
|
||||||
|
|
||||||
|
[status]
|
||||||
|
symbol = "[x](bold red) "
|
||||||
|
|
||||||
[sudo]
|
[sudo]
|
||||||
symbol = "sudo "
|
symbol = "sudo "
|
||||||
|
|
||||||
|
@ -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]
|
#[test]
|
||||||
fn failure_hex_status() {
|
fn failure_hex_status() {
|
||||||
let exit_values = [1, 2, 130, -2_147_467_260, 2_147_500_036];
|
let exit_values = [1, 2, 130, -2_147_467_260, 2_147_500_036];
|
||||||
|
Loading…
Reference in New Issue
Block a user