Skip to content

Commit c57fde2

Browse files
committed
std: adjust str::test_add so that the macro expands to all 3 items (rust-lang#8012).
Closes rust-lang#3682.
1 parent f8cf234 commit c57fde2

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

Diff for: src/libstd/str.rs

+14-11
Original file line numberDiff line numberDiff line change
@@ -3304,19 +3304,22 @@ mod tests {
33043304
fn test_add() {
33053305
#[allow(unnecessary_allocation)];
33063306
macro_rules! t (
3307-
($s1:expr, $s2:expr, $e:expr) => {
3308-
assert_eq!($s1 + $s2, $e);
3309-
assert_eq!($s1.to_owned() + $s2, $e);
3310-
assert_eq!($s1.to_managed() + $s2, $e);
3311-
}
3307+
($s1:expr, $s2:expr, $e:expr) => { {
3308+
let s1 = $s1;
3309+
let s2 = $s2;
3310+
let e = $e;
3311+
assert_eq!(s1 + s2, e.to_owned());
3312+
assert_eq!(s1.to_owned() + s2, e.to_owned());
3313+
assert_eq!(s1.to_managed() + s2, e.to_owned());
3314+
} }
33123315
);
33133316
3314-
t!("foo", "bar", ~"foobar");
3315-
t!("foo", @"bar", ~"foobar");
3316-
t!("foo", ~"bar", ~"foobar");
3317-
t!("ศไทย中", "华Việt Nam", ~"ศไทย中华Việt Nam");
3318-
t!("ศไทย中", @"华Việt Nam", ~"ศไทย中华Việt Nam");
3319-
t!("ศไทย中", ~"华Việt Nam", ~"ศไทย中华Việt Nam");
3317+
t!("foo", "bar", "foobar");
3318+
t!("foo", @"bar", "foobar");
3319+
t!("foo", ~"bar", "foobar");
3320+
t!("ศไทย中", "华Việt Nam", "ศไทย中华Việt Nam");
3321+
t!("ศไทย中", @"华Việt Nam", "ศไทย中华Việt Nam");
3322+
t!("ศไทย中", ~"华Việt Nam", "ศไทย中华Việt Nam");
33203323
}
33213324
33223325
#[test]

0 commit comments

Comments
 (0)