Skip to content

Commit

Permalink
tests: use vim/neovim binary name in messages
Browse files Browse the repository at this point in the history
  • Loading branch information
laniakea64 committed Apr 27, 2024
1 parent c151f92 commit cd9bc6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::{
pub use tempfile::tempdir;
use wait_timeout::ChildExt;

static VIM_BIN: Lazy<OsString> = Lazy::new(|| {
pub static VIM_BIN: Lazy<OsString> = Lazy::new(|| {
let default_vim = OsString::from("vim");
let v = env::var_os("TEST_VIM").unwrap_or(default_vim.clone());
if v.is_empty() {
Expand All @@ -25,7 +25,7 @@ static VIM_BIN: Lazy<OsString> = Lazy::new(|| {
v
}
});
pub static TEST_NVIM: Lazy<bool> = Lazy::new(|| {
static TEST_NVIM: Lazy<bool> = Lazy::new(|| {
PathBuf::from(&*VIM_BIN)
.file_stem()
.unwrap()
Expand Down Expand Up @@ -105,7 +105,7 @@ pub fn run_vim(args: Vec<&str>, output: &PathBuf, interrupted: &Arc<AtomicBool>)
ErrorKind::Other,
format!(
"{} failed with status: {}",
if *TEST_NVIM { "Neovim" } else { "Vim" },
&*VIM_BIN.to_string_lossy(),
status
),
))
Expand Down
2 changes: 1 addition & 1 deletion tests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn _main() -> io::Result<()> {

eprintln!(
"{} total execution time: {}s.",
if *TEST_NVIM { "Neovim" } else { "Vim" },
&*VIM_BIN.to_string_lossy(),
total_vim_time.load(Relaxed) as f64 / 1000.0
);

Expand Down

0 comments on commit cd9bc6f

Please sign in to comment.