diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:25 +0000 |
commit | 5363f350887b1e5b5dd21a86f88c8af9d7fea6da (patch) | |
tree | 35ca005eb6e0e9a1ba3bb5dbc033209ad445dc17 /vendor/pretty_assertions/examples | |
parent | Adding debian version 1.66.0+dfsg1-1. (diff) | |
download | rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.tar.xz rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.zip |
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/pretty_assertions/examples')
-rw-r--r-- | vendor/pretty_assertions/examples/standard_assertion.rs | 19 |
1 files changed, 12 insertions, 7 deletions
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<String, String>, - } +#[derive(Debug, PartialEq)] +struct Foo { + lorem: &'static str, + ipsum: u32, + dolor: Result<String, String>, +} +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"); +} |