in src/parser.rs [2088:2159]
fn test_parser_jacoco_kotlin() {
let mut lines: BTreeMap<u32, u64> = BTreeMap::new();
for i in &[
(5, 0),
(9, 0),
(14, 0),
(27, 0),
(30, 0),
(32, 0),
(41, 0),
(49, 0),
(57, 0),
(65, 0),
(73, 0),
(81, 0),
(89, 0),
(97, 0),
(104, 0),
(105, 0),
(106, 0),
(107, 0),
(108, 0),
(109, 0),
(110, 0),
(111, 0),
(112, 0),
(118, 0),
(119, 0),
(120, 0),
] {
lines.insert(i.0, i.1);
}
let mut functions: FunctionMap = FxHashMap::default();
for (name, start, executed) in vec![
("Breakpoint#getEntries", 112, false),
("BreakpointValue#xxsmall", 49, false),
("Breakpoint#<clinit>", 104, false),
("BreakpointValue#xxlarge", 97, false),
("BreakpointValue#none", 41, false),
("BreakpointValue#xlarge", 89, false),
("BreakpointValue#setValue", 26, false),
("BreakpointValue#<init>", 5, false),
("BreakpointValue#getBreakpointValueMap", 14, false),
("BreakpointDirection#getEntries", 120, false),
("BreakpointValue#small", 65, false),
("BreakpointDirection#<clinit>", 118, false),
("BreakpointValue#xsmall", 57, false),
("BreakpointValue#large", 81, false),
("BreakpointValue#medium", 73, false),
] {
functions.insert(String::from(name), Function { start, executed });
}
let mut branches: BTreeMap<u32, Vec<bool>> = BTreeMap::new();
branches.insert(26, vec![false, false, false, false]);
let expected = vec![(
String::from("BreakpointValue.kt"),
CovResult {
lines,
branches,
functions,
},
)];
let f =
File::open("./test/jacoco/kotlin-jacoco-report.xml").expect("Failed to open xml file");
let file = BufReader::new(&f);
let results = parse_jacoco_xml_report(file).unwrap();
assert_eq!(results, expected);
}