forked from extern/nushell
- Fixes issue #11982 # Description Expressions with unbalanced parenthesis [excess closing ')' parenthesis] will throw an error instead of interpreting ')' as a string. Solved he same way as closing braces '}' are handled.   # User-Facing Changes - Trailing closing parentheses ')' which do not match the number of opening parentheses '(' will lead to a parse error. - From what I have found in the documentation this is the intended behavior, thus no documentation has been updated on my part # Tests + Formatting - Two tests added in src/tests/test_parser.rs - All previous tests are still passing - cargo fmt, clippy and test have been run Unable to get the following command run - `cargo run -- -c "use std testing; testing run-tests --path crates/nu-std"` to run the tests for the standard library  --------- Co-authored-by: Noak Jönsson <noakj@kth.se>
This commit is contained in:
@ -550,6 +550,16 @@ fn unbalanced_delimiter4() -> TestResult {
|
||||
fail_test(r#"}"#, "unbalanced { and }")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unbalanced_parens1() -> TestResult {
|
||||
fail_test(r#")"#, "unbalanced ( and )")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unbalanced_parens2() -> TestResult {
|
||||
fail_test(r#"("("))"#, "unbalanced ( and )")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn register_with_string_literal() -> TestResult {
|
||||
fail_test(r#"register 'nu-plugin-math'"#, "File not found")
|
||||
|
Reference in New Issue
Block a user