diff --git a/tests/support/mod.rs b/tests/support/mod.rs index cde930e9..f3c04405 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -62,13 +62,12 @@ impl Test { } pub fn shim(&self, name: &str) -> &Test { - link_or_copy( - &self.gcc, - self.td - .path() - .join(&format!("{}{}", name, env::consts::EXE_SUFFIX)), - ) - .unwrap(); + let name = if name.ends_with(env::consts::EXE_SUFFIX) { + name.to_string() + } else { + format!("{}{}", name, env::consts::EXE_SUFFIX) + }; + link_or_copy(&self.gcc, self.td.path().join(name)).unwrap(); self }