Skip to content

Commit

Permalink
Update test suite to nightly-2024-06-12
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jun 13, 2024
1 parent 5a88bc4 commit a9d952e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/test_ensure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,18 @@ fn test_closure() {
// identifier, nor as `(S + move || 1) == (1)` by misinterpreting the
// closure precedence.
let test = || Ok(ensure!(S + move || 1 == 1));
assert_err(test, "Condition failed: `S + (move || 1 == 1)`");
assert_err(test, "Condition failed: `S + move || 1 == 1`");

let test = || Ok(ensure!(S + || 1 == 1));
assert_err(test, "Condition failed: `S + (|| 1 == 1)`");
assert_err(test, "Condition failed: `S + || 1 == 1`");

// Must not partition as `S + ((move | ()) | 1) == 1` by treating those
// pipes as bitwise-or.
let test = || Ok(ensure!(S + move |()| 1 == 1));
assert_err(test, "Condition failed: `S + (move |()| 1 == 1)`");
assert_err(test, "Condition failed: `S + move |()| 1 == 1`");

let test = || Ok(ensure!(S + |()| 1 == 1));
assert_err(test, "Condition failed: `S + (|()| 1 == 1)`");
assert_err(test, "Condition failed: `S + |()| 1 == 1`");
}

#[test]
Expand Down Expand Up @@ -224,7 +224,7 @@ fn test_if() {
let test = || Ok(ensure!(if let | 1 | 2 = 2 {}.t(1) == 2));
assert_err(
test,
"Condition failed: `if let 1 | 2 = 2 {}.t(1) == 2` (1 vs 2)",
"Condition failed: `if let | 1 | 2 = 2 {}.t(1) == 2` (1 vs 2)",
);
}

Expand Down Expand Up @@ -269,7 +269,7 @@ fn test_loop() {
let test = || Ok(ensure!(for | _x in iter::once(0) {}.t(1) == 2));
assert_err(
test,
"Condition failed: `for _x in iter::once(0) {}.t(1) == 2` (1 vs 2)",
"Condition failed: `for | _x in iter::once(0) {}.t(1) == 2` (1 vs 2)",
);

#[rustfmt::skip]
Expand All @@ -286,7 +286,7 @@ fn test_match() {
let test = || Ok(ensure!(match 1 == 1 { true => 1, false => 0 } == 2));
assert_err(
test,
"Condition failed: `match 1 == 1 { true => 1, false => 0, } == 2` (1 vs 2)",
"Condition failed: `match 1 == 1 { true => 1, false => 0 } == 2` (1 vs 2)",
);
}

Expand Down Expand Up @@ -343,7 +343,7 @@ fn test_path() {
let test = || Ok(ensure!(Error::msg::<&str,>.t(1) == 2));
assert_err(
test,
"Condition failed: `Error::msg::<&str>.t(1) == 2` (1 vs 2)",
"Condition failed: `Error::msg::<&str,>.t(1) == 2` (1 vs 2)",
);

let test = || Ok(ensure!(Error::msg::<<str as ToOwned>::Owned>.t(1) == 2));
Expand All @@ -362,7 +362,7 @@ fn test_path() {
let test = || Ok(ensure!(Chain::<'static,>::new.t(1) == 2));
assert_err(
test,
"Condition failed: `Chain::<'static>::new.t(1) == 2` (1 vs 2)",
"Condition failed: `Chain::<'static,>::new.t(1) == 2` (1 vs 2)",
);

fn f<const I: isize>() {}
Expand Down Expand Up @@ -394,7 +394,7 @@ fn test_path() {

#[rustfmt::skip]
let test = || Ok(ensure!(E::U::<u8,>>E::U));
assert_err(test, "Condition failed: `E::U::<u8> > E::U` (U vs U)");
assert_err(test, "Condition failed: `E::U::<u8,> > E::U` (U vs U)");

let test = || Ok(ensure!(Generic::<dyn Debug + Sync> != Generic));
assert_err(
Expand All @@ -416,7 +416,7 @@ fn test_path() {
};
assert_err(
test,
"Condition failed: `Generic::<dyn Fn() + ::std::marker::Sync> != Generic` (Generic vs Generic)",
"Condition failed: `Generic::<dyn Fn::() + ::std::marker::Sync> != Generic` (Generic vs Generic)",
);
}

Expand Down

0 comments on commit a9d952e

Please sign in to comment.