mirror of
https://github.com/lsd-rs/lsd
synced 2025-03-04 23:17:15 +00:00
Add a simple test for symlink rendering with color
This commit is contained in:
parent
1ae8e4a926
commit
4b9de0bbd0
1 changed files with 18 additions and 0 deletions
|
@ -115,4 +115,22 @@ mod tests {
|
|||
.to_string()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_symlink_render_default_invalid_target_withcolor() {
|
||||
let link = SymLink {
|
||||
target: Some("/target".to_string()),
|
||||
valid: false,
|
||||
};
|
||||
let argv = vec!["lsd"];
|
||||
let matches = app::build().get_matches_from_safe(argv).unwrap();
|
||||
assert_eq!(
|
||||
format!("{}", " ⇒ \u{1b}[38;5;124m/target\u{1b}[39m"),
|
||||
link.render(
|
||||
&Colors::new(ThemeOption::NoLscolors),
|
||||
&Flags::configure_from(&matches, &Config::with_none()).unwrap()
|
||||
)
|
||||
.to_string()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue