fn test_path_mapping_file()

in src/mapping.rs [363:380]


    fn test_path_mapping_file() {
        let mappings = PathMappings::new(&None, &None, &None, &Some("./test_data/mapping.json"))
            .unwrap()
            .unwrap();

        let files = vec![
            ("/home/worker/a/c/ddd.cpp", "hg:hg.mozilla.org/mozilla-central:a/c/ddd.cpp:6639deb894172375b05d6791f5f8c7d53ca79723"),
            ("./test_data/mapping/bbb.cpp", "s3:gecko-generated-sources:cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e/bbb.cpp"),
            ("/rustc/f3e1a954d2ead4e2fc197c7da7d71e6c61bad196/src/libcore/str/pattern.rs", "git:github.com/rust-lang/rust:src/libcore/str/pattern.rs:f3e1a954d2ead4e2fc197c7da7d71e6c61bad196"),
            ("./test_data/mapping/aaa.cpp", "s3:gecko-generated-sources:cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e/aaa.cpp"),
            ("/cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/print.rs", "https://doc.rs/0.3.40/backtrace/src/print.rs.html"),
            ("./test_data/mapping/ccc.cpp", "s3:gecko-generated-sources:cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e/ccc.cpp"),
        ];

        for (path, expected) in files {
            assert_eq!(mappings.map(path).unwrap().unwrap(), expected.to_string())
        }
    }