diff options
| author | Niels Egberts <git@nielsegberts.nl> | 2014-12-08 23:12:03 +0000 |
|---|---|---|
| committer | Niels Egberts <git@nielsegberts.nl> | 2014-12-09 00:09:42 +0000 |
| commit | 2dc338dfdb964a3a3ba6b434143c29ebe4233c7e (patch) | |
| tree | f4cb2cfd4039cd6a0bf9f29488f06f1cbf31fd7d /src/libstd | |
| parent | 84a7615418749d663d54dd9223a15098b834e2a0 (diff) | |
| download | rust-2dc338dfdb964a3a3ba6b434143c29ebe4233c7e.tar.gz rust-2dc338dfdb964a3a3ba6b434143c29ebe4233c7e.zip | |
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.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/macros.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 76419bee41c..032411b51d4 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -120,14 +120,14 @@ macro_rules! assert( /// ``` #[macro_export] macro_rules! assert_eq( - ($given:expr , $expected:expr) => ({ - match (&($given), &($expected)) { - (given_val, expected_val) => { + ($left:expr , $right:expr) => ({ + match (&($left), &($right)) { + (left_val, right_val) => { // check both directions of equality.... - if !((*given_val == *expected_val) && - (*expected_val == *given_val)) { + if !((*left_val == *right_val) && + (*right_val == *left_val)) { panic!("assertion failed: `(left == right) && (right == left)` \ - (left: `{}`, right: `{}`)", *given_val, *expected_val) + (left: `{}`, right: `{}`)", *left_val, *right_val) } } } |
