From bd6494d1194781f798f5eeaa822adc76dd27048e Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Sat, 16 Apr 2022 20:51:55 +0100 Subject: fix(cli/tools/test): Prefix test module paths with "./" (#14301) --- cli/tools/test.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cli/tools') diff --git a/cli/tools/test.rs b/cli/tools/test.rs index e3c6507fe..96e0dd8c3 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -253,10 +253,14 @@ impl PrettyTestReporter { fn to_relative_path_or_remote_url(&self, path_or_url: &str) -> String { let url = Url::parse(path_or_url).unwrap(); if url.scheme() == "file" { - self.cwd.make_relative(&url).unwrap() - } else { - path_or_url.to_string() + if let Some(mut r) = self.cwd.make_relative(&url) { + if !r.starts_with("../") { + r = format!("./{}", r); + } + return r; + } } + path_or_url.to_string() } fn force_report_step_wait(&mut self, description: &TestStepDescription) { -- cgit v1.2.3