Skip to content

Commit 7c6c633

Browse files
committed
test: nu-highlight for aliased externals
1 parent 47c8a13 commit 7c6c633

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

crates/nu-cli/tests/commands/nu_highlight.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,23 @@ fn nu_highlight_where_row_condition() {
1111
let actual = nu!("'ls | where a b 12345(' | nu-highlight | ansi strip");
1212
assert_eq!(actual.out, "ls | where a b 12345(");
1313
}
14+
15+
#[test]
16+
fn nu_highlight_aliased_external_resolved() {
17+
let actual = nu!(r#"$env.config.highlight_resolved_externals = true
18+
$env.config.color_config.shape_external_resolved = '#ffffff'
19+
alias fff = ^sleep
20+
('fff' | nu-highlight | split row (ansi reset) | get 0) has (ansi $env.config.color_config.shape_external_resolved)"#);
21+
22+
assert_eq!(actual.out, "true");
23+
}
24+
25+
#[test]
26+
fn nu_highlight_aliased_external_unresolved() {
27+
let actual = nu!(r#"$env.config.highlight_resolved_externals = true
28+
$env.config.color_config.shape_external = '#ffffff'
29+
alias fff = ^nonexist
30+
('fff' | nu-highlight | split row (ansi reset) | get 0) has (ansi $env.config.color_config.shape_external)"#);
31+
32+
assert_eq!(actual.out, "true");
33+
}

0 commit comments

Comments
 (0)