Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smessmer committed Feb 7, 2024
1 parent fcb5a2f commit 3395b5f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/utils/infallible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,23 @@ where
}
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn infallible_unwrap() {
let value: Result<u32, Infallible> = Ok(2);
assert_eq!(2, value.infallible_unwrap());
}

struct AlternativeInfallible {}
impl IsInfallible for AlternativeInfallible {}

#[test]
fn alternative_infallible_unwrap() {
let value: Result<u32, AlternativeInfallible> = Ok(2);
assert_eq!(2, value.infallible_unwrap());
}
}

0 comments on commit 3395b5f

Please sign in to comment.