From 6f23cf30354f97260ca409515aaa30cbcbd5b98d Mon Sep 17 00:00:00 2001 From: Riccardo Mazzarini Date: Wed, 29 Mar 2023 18:47:50 +0200 Subject: [PATCH] (oxi-test): fail if Neovim exits with a non-zero exit code --- crates/oxi-test/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/oxi-test/src/lib.rs b/crates/oxi-test/src/lib.rs index b631da04..ced3fff3 100644 --- a/crates/oxi-test/src/lib.rs +++ b/crates/oxi-test/src/lib.rs @@ -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);