Skip to content
Myr

Merge pull request #378 from dtolnay/ttpretty

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Update test suite to nightly-2024-06-12

authored by David Tolnay · committed by GitHub · parents 5a88bc4, a9d952e · Browse files · 1 file+11 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−11 removed

  • tests:+11 added−11 removed

1 file+11 added−11 removed

modified:tests/test_ensure.rs+11 added-11 removed
151 unmodified lines
152 // Must not partition as `(S + move) || (1 == 1)` by treating move as an153 // identifier, nor as `(S + move || 1) == (1)` by misinterpreting the154 // closure precedence.155 let test = || Ok(ensure!(S + move || 1 == 1));156 assert_err(test, "Condition failed: `S + (move || 1 == 1)`");156 assert_err(test, "Condition failed: `S + move || 1 == 1`");157158 let test = || Ok(ensure!(S + || 1 == 1));159 assert_err(test, "Condition failed: `S + (|| 1 == 1)`");159 assert_err(test, "Condition failed: `S + || 1 == 1`");160161 // Must not partition as `S + ((move | ()) | 1) == 1` by treating those162 // pipes as bitwise-or.163 let test = || Ok(ensure!(S + move |()| 1 == 1));164 assert_err(test, "Condition failed: `S + (move |()| 1 == 1)`");164 assert_err(test, "Condition failed: `S + move |()| 1 == 1`");165166 let test = || Ok(ensure!(S + |()| 1 == 1));167 assert_err(test, "Condition failed: `S + (|()| 1 == 1)`");167 assert_err(test, "Condition failed: `S + |()| 1 == 1`");168}169170#[test]171fn test_unary() {
51 unmodified lines
223 #[rustfmt::skip]224 let test = || Ok(ensure!(if let | 1 | 2 = 2 {}.t(1) == 2));225 assert_err(226 test,227 "Condition failed: `if let 1 | 2 = 2 {}.t(1) == 2` (1 vs 2)",227 "Condition failed: `if let | 1 | 2 = 2 {}.t(1) == 2` (1 vs 2)",228 );229}230231#[test]
36 unmodified lines
268 #[rustfmt::skip]269 let test = || Ok(ensure!(for | _x in iter::once(0) {}.t(1) == 2));270 assert_err(271 test,272 "Condition failed: `for _x in iter::once(0) {}.t(1) == 2` (1 vs 2)",272 "Condition failed: `for | _x in iter::once(0) {}.t(1) == 2` (1 vs 2)",273 );274275 #[rustfmt::skip]276 let test = || Ok(ensure!(for true | false in iter::empty() {}.t(1) == 2));
8 unmodified lines
285 #[rustfmt::skip]286 let test = || Ok(ensure!(match 1 == 1 { true => 1, false => 0 } == 2));287 assert_err(288 test,289 "Condition failed: `match 1 == 1 { true => 1, false => 0, } == 2` (1 vs 2)",289 "Condition failed: `match 1 == 1 { true => 1, false => 0 } == 2` (1 vs 2)",290 );291}292293#[test]
48 unmodified lines
342 #[rustfmt::skip]343 let test = || Ok(ensure!(Error::msg::<&str,>.t(1) == 2));344 assert_err(345 test,346 "Condition failed: `Error::msg::<&str>.t(1) == 2` (1 vs 2)",346 "Condition failed: `Error::msg::<&str,>.t(1) == 2` (1 vs 2)",347 );348349 let test = || Ok(ensure!(Error::msg::<<str as ToOwned>::Owned>.t(1) == 2));350 assert_err(
10 unmodified lines
361 #[rustfmt::skip]362 let test = || Ok(ensure!(Chain::<'static,>::new.t(1) == 2));363 assert_err(364 test,365 "Condition failed: `Chain::<'static>::new.t(1) == 2` (1 vs 2)",365 "Condition failed: `Chain::<'static,>::new.t(1) == 2` (1 vs 2)",366 );367368 fn f<const I: isize>() {}369 let test = || Ok(ensure!(f::<1>() != ()));
23 unmodified lines
393 assert_err(test, "Condition failed: `E::U::<u8> > E::U` (U vs U)");394395 #[rustfmt::skip]396 let test = || Ok(ensure!(E::U::<u8,>>E::U));397 assert_err(test, "Condition failed: `E::U::<u8> > E::U` (U vs U)");397 assert_err(test, "Condition failed: `E::U::<u8,> > E::U` (U vs U)");398399 let test = || Ok(ensure!(Generic::<dyn Debug + Sync> != Generic));400 assert_err(401 test,
13 unmodified lines
415 ))416 };417 assert_err(418 test,419 "Condition failed: `Generic::<dyn Fn() + ::std::marker::Sync> != Generic` (Generic vs Generic)",419 "Condition failed: `Generic::<dyn Fn::() + ::std::marker::Sync> != Generic` (Generic vs Generic)",420 );421}422423#[test]
318 unmodified lines