From 7efb4bd511122cf77ff1e4813433aa94714ab201 Mon Sep 17 00:00:00 2001 From: rami3l Date: Sun, 29 Dec 2024 10:37:48 +0800 Subject: [PATCH] feat(test): accept more than one args in `for_host*!()` --- src/test.rs | 4 ++-- tests/suite/cli_rustup.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test.rs b/src/test.rs index ade2c2e901..afc69dbc66 100644 --- a/src/test.rs +++ b/src/test.rs @@ -178,8 +178,8 @@ pub fn this_host_triple() -> String { // Format a string with this host triple. #[macro_export] macro_rules! for_host { - ($s: expr) => { - &format!($s, $crate::test::this_host_triple()) + ($s:tt $($arg:tt)*) => { + &format!($s, $crate::test::this_host_triple() $($arg)*) }; } diff --git a/tests/suite/cli_rustup.rs b/tests/suite/cli_rustup.rs index bae23ad5b7..0620d75cc9 100644 --- a/tests/suite/cli_rustup.rs +++ b/tests/suite/cli_rustup.rs @@ -15,8 +15,8 @@ use rustup::test::{ use rustup::utils::raw; macro_rules! for_host_and_home { - ($config:expr, $s: expr) => { - &format!($s, this_host_triple(), $config.rustupdir) + ($config:expr, $s:tt $($arg:tt)*) => { + &format!($s, this_host_triple(), $config.rustupdir $($arg)*) }; }