avoid freeze for table print (#6688)

* avoid freeze for table print

* make failed_with_proper_exit_code work again

* add test case for table

* fix un-used import on windows
This commit is contained in:
WindSoilder
2022-10-10 20:32:55 +08:00
committed by GitHub
parent 2f1711f783
commit 1998bce19f
4 changed files with 46 additions and 24 deletions

View File

@ -314,11 +314,10 @@ mod nu_commands {
}
#[test]
#[ignore = "For now we have no way to check LAST_EXIT_CODE in tests, ignore it for now"]
fn failed_with_proper_exit_code() {
Playground::setup("external failed", |dirs, _sandbox| {
let actual = nu!(cwd: dirs.test(), r#"
nu -c "cargo build; print $env.LAST_EXIT_CODE"
nu -c "cargo build | complete | get exit_code"
"#);
// cargo for non rust project's exit code is 101.