mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 12:15:42 +02:00
allow early return outside of main (#10514)
# Description Fixes: #9792 When evaluating file, we need to allow early return if we evaluate script file first.
This commit is contained in:
@ -23,3 +23,12 @@ fn return_works_in_script_without_def_main() {
|
||||
|
||||
assert!(actual.err.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn return_works_in_script_with_def_main() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
pipeline("nu early_return_outside_main.nu")
|
||||
);
|
||||
assert!(actual.err.is_empty());
|
||||
}
|
||||
|
Reference in New Issue
Block a user