diff --git a/crates/nu-cli/tests/commands/mod.rs b/crates/nu-cli/tests/commands/mod.rs new file mode 100644 index 0000000000..00488f0b9e --- /dev/null +++ b/crates/nu-cli/tests/commands/mod.rs @@ -0,0 +1 @@ +mod nu_highlight; diff --git a/crates/nu-cli/tests/commands/nu_highlight.rs b/crates/nu-cli/tests/commands/nu_highlight.rs new file mode 100644 index 0000000000..bd185a8634 --- /dev/null +++ b/crates/nu-cli/tests/commands/nu_highlight.rs @@ -0,0 +1,7 @@ +use nu_test_support::nu; + +#[test] +fn nu_highlight_not_expr() { + let actual = nu!("'not false' | nu-highlight | ansi strip"); + assert_eq!(actual.out, "not false"); +} diff --git a/crates/nu-cli/tests/completions.rs b/crates/nu-cli/tests/completions/mod.rs similarity index 100% rename from crates/nu-cli/tests/completions.rs rename to crates/nu-cli/tests/completions/mod.rs diff --git a/crates/nu-cli/tests/support/completions_helpers.rs b/crates/nu-cli/tests/completions/support/completions_helpers.rs similarity index 100% rename from crates/nu-cli/tests/support/completions_helpers.rs rename to crates/nu-cli/tests/completions/support/completions_helpers.rs diff --git a/crates/nu-cli/tests/support/mod.rs b/crates/nu-cli/tests/completions/support/mod.rs similarity index 100% rename from crates/nu-cli/tests/support/mod.rs rename to crates/nu-cli/tests/completions/support/mod.rs diff --git a/crates/nu-cli/tests/main.rs b/crates/nu-cli/tests/main.rs new file mode 100644 index 0000000000..a040a731f3 --- /dev/null +++ b/crates/nu-cli/tests/main.rs @@ -0,0 +1,2 @@ +mod commands; +mod completions; diff --git a/crates/nu-parser/src/flatten.rs b/crates/nu-parser/src/flatten.rs index e70a48e9f1..92b424783a 100644 --- a/crates/nu-parser/src/flatten.rs +++ b/crates/nu-parser/src/flatten.rs @@ -180,12 +180,12 @@ fn flatten_expression_into( flatten_expression_into(working_set, op, output); flatten_expression_into(working_set, rhs, output); } - Expr::UnaryNot(expr) => { + Expr::UnaryNot(not) => { output.push(( Span::new(expr.span.start, expr.span.start + 3), FlatShape::Operator, )); - flatten_expression_into(working_set, expr, output); + flatten_expression_into(working_set, not, output); } Expr::Closure(block_id) => { let outer_span = expr.span;