Skip to content

Commit b0372c5

Browse files
committed
fix: test case
1 parent e66da04 commit b0372c5

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

crates/nu-parser/src/parse_keywords.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,13 +1852,12 @@ pub fn parse_export_env(
18521852
call_kind,
18531853
} = parse_internal_call(working_set, spans[0], &[spans[1]], decl_id);
18541854

1855-
let call_span = Span::concat(spans);
18561855
if call_kind != CallKind::Valid {
18571856
return (
18581857
Pipeline::from_vec(vec![Expression::new(
18591858
working_set,
18601859
Expr::Call(call),
1861-
call_span,
1860+
Span::concat(spans),
18621861
output,
18631862
)]),
18641863
None,
@@ -2785,12 +2784,11 @@ pub fn parse_hide(working_set: &mut StateWorkingSet, lite_command: &LiteCommand)
27852784
call_kind,
27862785
} = parse_internal_call(working_set, spans[0], &spans[1..], decl_id);
27872786

2788-
let call_span = Span::concat(spans);
27892787
if call_kind != CallKind::Valid {
27902788
return Pipeline::from_vec(vec![Expression::new(
27912789
working_set,
27922790
Expr::Call(call),
2793-
call_span,
2791+
Span::concat(spans),
27942792
output,
27952793
)]);
27962794
}

tests/repl/test_custom_commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn def_twice_should_fail() -> TestResult {
5050

5151
#[test]
5252
fn missing_parameters() -> TestResult {
53-
fail_test(r#"def foo {}"#, "Missing required positional")
53+
fail_test(r#"def foo {}"#, "expected [ or (")
5454
}
5555

5656
#[test]

0 commit comments

Comments
 (0)