fn test_lcov_demangle()

in src/output.rs [734:780]


    fn test_lcov_demangle() {
        let tmp_dir = tempfile::tempdir().expect("Failed to create temporary directory");
        let file_name = "test_lcov_demangle";
        let file_path = tmp_dir.path().join(file_name);

        let results = vec![(
            PathBuf::from("foo/bar/a.cpp"),
            PathBuf::from("foo/bar/a.cpp"),
            CovResult {
                lines: BTreeMap::new(),
                branches: BTreeMap::new(),
                functions: {
                    let mut map = FxHashMap::default();
                    map.insert(
                        "_RINvNtC3std3mem8align_ofNtNtC3std3mem12DiscriminantE".to_string(),
                        Function {
                            start: 1,
                            executed: true,
                        },
                    );
                    map.insert(
                        "_ZN9wikipedia7article6formatEv".to_string(),
                        Function {
                            start: 2,
                            executed: true,
                        },
                    );
                    map.insert(
                        "hello_world".to_string(),
                        Function {
                            start: 3,
                            executed: true,
                        },
                    );
                    map
                },
            },
        )];

        output_lcov(&results, Some(&file_path), true);

        let results = read_file(&file_path);

        assert!(results.contains("FN:1,std::mem::align_of::<std::mem::Discriminant>\n"));
        assert!(results.contains("FN:2,wikipedia::article::format\n"));
        assert!(results.contains("FN:3,hello_world\n"));
    }