From 5363f350887b1e5b5dd21a86f88c8af9d7fea6da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:25 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- .../pretty_assertions/examples/standard_assertion.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'vendor/pretty_assertions/examples') diff --git a/vendor/pretty_assertions/examples/standard_assertion.rs b/vendor/pretty_assertions/examples/standard_assertion.rs index fddd512f4..0a612c82e 100644 --- a/vendor/pretty_assertions/examples/standard_assertion.rs +++ b/vendor/pretty_assertions/examples/standard_assertion.rs @@ -1,11 +1,11 @@ -fn main() { - #[derive(Debug, PartialEq)] - struct Foo { - lorem: &'static str, - ipsum: u32, - dolor: Result, - } +#[derive(Debug, PartialEq)] +struct Foo { + lorem: &'static str, + ipsum: u32, + dolor: Result, +} +fn compare() { let x = Some(Foo { lorem: "Hello World!", ipsum: 42, @@ -19,3 +19,8 @@ fn main() { assert_eq!(x, y); } + +fn main() { + let result = std::panic::catch_unwind(compare); + assert!(result.is_err(), "example did not panic"); +} -- cgit v1.2.3