Skip to content

Commit

Permalink
(oxi-test): fail if Neovim exits with a non-zero exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
noib3 committed Apr 1, 2023
1 parent 42944fc commit 6f23cf3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/oxi-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ pub fn oxi_test(attr: TokenStream, item: TokenStream) -> TokenStream {
])
.args(["+quit"])
.output()
.expect("Couldn't find `nvim` binary in $PATH!");
.expect("Couldn't find `nvim` binary in $PATH");

if !out.status.success() {
if let Some(code) = out.status.code() {
panic!("Neovim exited with non-zero exit code: {}", code);
} else {
panic!("Neovim segfaulted");
}
}

let stderr = String::from_utf8_lossy(&out.stderr);

Expand Down

0 comments on commit 6f23cf3

Please sign in to comment.