summaryrefslogtreecommitdiff
path: root/cli/tools/test.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2022-04-16 20:51:55 +0100
committerGitHub <noreply@github.com>2022-04-16 21:51:55 +0200
commitbd6494d1194781f798f5eeaa822adc76dd27048e (patch)
treee7bd456c8cc8f57dfdabf42cbcbcff9a83f993c8 /cli/tools/test.rs
parent5f2d9a4a220307b1111c91dfac74951ef3925457 (diff)
fix(cli/tools/test): Prefix test module paths with "./" (#14301)
Diffstat (limited to 'cli/tools/test.rs')
-rw-r--r--cli/tools/test.rs10
1 files changed, 7 insertions, 3 deletions
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) {