From 2a7a198d580cdcbb8adda9bc8d47105a708ae827 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Sun, 12 May 2024 00:56:45 +0200 Subject: [PATCH] Try to fix test runner on Windows --- crates/lune/src/tests.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/lune/src/tests.rs b/crates/lune/src/tests.rs index fa1514a..ae599da 100644 --- a/crates/lune/src/tests.rs +++ b/crates/lune/src/tests.rs @@ -1,4 +1,5 @@ use std::env::set_current_dir; +use std::path::PathBuf; use std::process::ExitCode; use anyhow::Result; @@ -6,6 +7,8 @@ use console::set_colors_enabled; use console::set_colors_enabled_stderr; use tokio::fs::read_to_string; +use lune_utils::path::clean_path_and_make_absolute; + use crate::Runtime; const ARGS: &[&str] = &["Foo", "Bar"]; @@ -17,7 +20,7 @@ macro_rules! create_tests { // We need to change the current directory to the workspace root since // we are in a sub-crate and tests would run relative to the sub-crate let workspace_dir_str = format!("{}/../../", env!("CARGO_MANIFEST_DIR")); - let workspace_dir = std::path::PathBuf::from(workspace_dir_str).canonicalize()?; + let workspace_dir = clean_path_and_make_absolute(PathBuf::from(workspace_dir_str)); set_current_dir(&workspace_dir)?; // Disable styling for stdout and stderr since