coverage: Migrate tests/run-coverage
into tests/coverage
This commit is contained in:
parent
aea7c27eae
commit
e9d04c5e24
105 changed files with 7 additions and 9 deletions
33
tests/coverage/drop_trait.rs
Normal file
33
tests/coverage/drop_trait.rs
Normal file
|
@ -0,0 +1,33 @@
|
|||
#![allow(unused_assignments)]
|
||||
// failure-status: 1
|
||||
|
||||
struct Firework {
|
||||
strength: i32,
|
||||
}
|
||||
|
||||
impl Drop for Firework {
|
||||
fn drop(&mut self) {
|
||||
println!("BOOM times {}!!!", self.strength);
|
||||
}
|
||||
}
|
||||
|
||||
fn main() -> Result<(), u8> {
|
||||
let _firecracker = Firework { strength: 1 };
|
||||
|
||||
let _tnt = Firework { strength: 100 };
|
||||
|
||||
if true {
|
||||
println!("Exiting with error...");
|
||||
return Err(1);
|
||||
}
|
||||
|
||||
let _ = Firework { strength: 1000 };
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Expected program output:
|
||||
// Exiting with error...
|
||||
// BOOM times 100!!!
|
||||
// BOOM times 1!!!
|
||||
// Error: 1
|
Loading…
Add table
Add a link
Reference in a new issue