diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/assertions_on_result_states.fixed')
-rw-r--r-- | src/tools/clippy/tests/ui/assertions_on_result_states.fixed | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/assertions_on_result_states.fixed b/src/tools/clippy/tests/ui/assertions_on_result_states.fixed index 7bde72e4b..795f435f2 100644 --- a/src/tools/clippy/tests/ui/assertions_on_result_states.fixed +++ b/src/tools/clippy/tests/ui/assertions_on_result_states.fixed @@ -27,6 +27,14 @@ fn main() { let r: Result<Foo, Foo> = Ok(Foo); assert!(r.is_ok()); + // test ok with some messages + let r: Result<Foo, DebugFoo> = Ok(Foo); + assert!(r.is_ok(), "oops"); + + // test ok with unit error + let r: Result<Foo, ()> = Ok(Foo); + assert!(r.is_ok()); + // test temporary ok fn get_ok() -> Result<Foo, DebugFoo> { Ok(Foo) |