Skip to content

Commit 5e890f7

Browse files
committed
Improve core::option coverage
1 parent 8b6802c commit 5e890f7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/coretests/tests/option.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ fn test_unwrap_or_else() {
248248
*/
249249
}
250250

251+
#[test]
252+
fn test_unwrap_or_default() {
253+
assert_eq!(Some(666u32).unwrap_or_default(), 666);
254+
assert_eq!(None::<u32>.unwrap_or_default(), 0);
255+
}
256+
251257
#[test]
252258
fn test_unwrap_unchecked() {
253259
assert_eq!(unsafe { Some(1).unwrap_unchecked() }, 1);

0 commit comments

Comments
 (0)