Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Add test for result matching #226

Merged
merged 1 commit into from
Sep 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,21 @@ fn error_patterns() {
}
}

#[test]
fn result_match() {
error_chain! { }

fn ok() -> Result<()> {
Ok(())
}

match ok() {
Ok(()) => {},
Err(Error(ErrorKind::Msg(_), _)) => {},
Err(..) => {},
}
}

#[test]
fn error_first() {
error_chain! {
Expand Down