Skip to content

Commit 2dc338d

Browse files
committed
Rename assert_eq arguments to left and right.
The names expected and actual are not used anymore in the output. It also removes the confusion that the argument order is the opposite of junit.
1 parent 84a7615 commit 2dc338d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libstd/macros.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ macro_rules! assert(
120120
/// ```
121121
#[macro_export]
122122
macro_rules! assert_eq(
123-
($given:expr , $expected:expr) => ({
124-
match (&($given), &($expected)) {
125-
(given_val, expected_val) => {
123+
($left:expr , $right:expr) => ({
124+
match (&($left), &($right)) {
125+
(left_val, right_val) => {
126126
// check both directions of equality....
127-
if !((*given_val == *expected_val) &&
128-
(*expected_val == *given_val)) {
127+
if !((*left_val == *right_val) &&
128+
(*right_val == *left_val)) {
129129
panic!("assertion failed: `(left == right) && (right == left)` \
130-
(left: `{}`, right: `{}`)", *given_val, *expected_val)
130+
(left: `{}`, right: `{}`)", *left_val, *right_val)
131131
}
132132
}
133133
}

0 commit comments

Comments
 (0)