Recover tests

This commit is contained in:
Liu Dingming 2023-02-22 21:36:30 +08:00
parent b9c617a1b7
commit 1a474d9179
2 changed files with 18 additions and 0 deletions

View File

@ -16,6 +16,18 @@ fn main() {
expect_result(); expect_result();
} }
#[test]
fn test_expect_option() {
let opt = Some(0);
let _ = opt.expect("");
}
#[test]
fn test_expect_result() {
let res: Result<u8, ()> = Ok(0);
let _ = res.expect("");
}
#[cfg(test)] #[cfg(test)]
mod issue9612 { mod issue9612 {
// should not lint in `#[cfg(test)]` modules // should not lint in `#[cfg(test)]` modules

View File

@ -66,6 +66,12 @@ fn main() {
} }
} }
#[test]
fn test() {
let boxed_slice: Box<[u8]> = Box::new([0, 1, 2, 3]);
let _ = boxed_slice.get(1).unwrap();
}
#[cfg(test)] #[cfg(test)]
mod issue9612 { mod issue9612 {
// should not lint in `#[cfg(test)]` modules // should not lint in `#[cfg(test)]` modules