mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 11:23:12 +02:00
avoid panic when using from nuon (#7533)
# Description Fixes #5996 Just found a relative easy way to fix the issue # User-Facing Changes ``` ❯ open $nu.plugin-path | from nuon Error: × error when loading nuon text ╭─[entry #36:1:1] 1 │ open $nu.plugin-path | from nuon · ────┬──── · ╰── could not load nuon text ╰──── Error: × Error when loading ❯ open $nu.config-path | from nuon Error: × error when loading nuon text ╭─[entry #37:1:1] 1 │ open $nu.config-path | from nuon · ────┬──── · ╰── could not load nuon text ╰──── Error: × error when loading ``` # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date.
This commit is contained in:
@ -340,6 +340,14 @@ fn quotes_some_strings_necessarily() {
|
||||
assert_eq!(actual.out, "list<string>");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn read_code_should_fail_rather_than_panic() {
|
||||
let actual = nu!(cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"open code.nu | from nuon"#
|
||||
));
|
||||
assert!(actual.err.contains("error when parsing"))
|
||||
}
|
||||
|
||||
proptest! {
|
||||
#[test]
|
||||
fn to_nuon_from_nuon(c: char) {
|
||||
|
Reference in New Issue
Block a user