in src/cobertura.rs [578:701]
fn coverage_result(which: Result) -> CovResult {
match which {
Result::Main => CovResult {
/* main.rs
fn main() {
let inp = "a";
if "a" == inp {
println!("a");
} else if "b" == inp {
println!("b");
}
println!("what?");
}
*/
lines: [
(1, 1),
(2, 1),
(3, 2),
(4, 1),
(5, 0),
(6, 0),
(8, 1),
(9, 1),
]
.iter()
.cloned()
.collect(),
branches: {
let mut map = BTreeMap::new();
map.insert(3, vec![true, false]);
map.insert(5, vec![false, false]);
map
},
functions: {
let mut map = FxHashMap::default();
map.insert(
"_ZN8cov_test4main17h7eb435a3fb3e6f20E".to_string(),
Function {
start: 1,
executed: true,
},
);
map
},
},
Result::Test => CovResult {
/* main.rs
fn main() {
}
#[test]
fn test_fn() {
let s = "s";
if s == "s" {
println!("test");
}
println!("test");
}
*/
lines: [
(1, 2),
(3, 0),
(6, 2),
(7, 1),
(8, 2),
(9, 1),
(11, 1),
(12, 2),
]
.iter()
.cloned()
.collect(),
branches: {
let mut map = BTreeMap::new();
map.insert(8, vec![true, false]);
map
},
functions: {
let mut map = FxHashMap::default();
map.insert(
"_ZN8cov_test7test_fn17hbf19ec7bfabe8524E".to_string(),
Function {
start: 6,
executed: true,
},
);
map.insert(
"_ZN8cov_test4main17h7eb435a3fb3e6f20E".to_string(),
Function {
start: 1,
executed: false,
},
);
map.insert(
"_ZN8cov_test4main17h29b45b3d7d8851d2E".to_string(),
Function {
start: 1,
executed: true,
},
);
map.insert(
"_ZN8cov_test7test_fn28_$u7b$$u7b$closure$u7d$$u7d$17hab7a162ac9b573fcE"
.to_string(),
Function {
start: 6,
executed: true,
},
);
map.insert(
"_ZN8cov_test4main17h679717cd8503f8adE".to_string(),
Function {
start: 1,
executed: false,
},
);
map
},
},
}
}