Skip to content

Commit

Permalink
Use expect instead of unwrap in tests
Browse files Browse the repository at this point in the history
paolobarbolini committed Jul 17, 2020
1 parent 3191221 commit d26eb4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/common.rs
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ macro_rules! test_format {

let expected_kind = Type::new($exp_matchert, $exp_mimet, $exp_ext, matcher);
let kind = infer::get_from_path(concat!("testdata/", $file))
.unwrap()
.unwrap();
.expect("test file read")
.expect("test file matches");

assert_eq!(expected_kind, kind);
}
@@ -23,8 +23,8 @@ macro_rules! test_format {
}

let expected_kind = Type::new($exp_matchert, $exp_mimet, $exp_ext, matcher);
let buf = core::include_bytes!(concat!("../testdata/", $file));
let kind = infer::get(buf).unwrap();
let buf = include_bytes!(concat!("../testdata/", $file));
let kind = infer::get(buf).expect("test file matches");

assert_eq!(expected_kind, kind);
}

0 comments on commit d26eb4b

Please sign in to comment.