Make robust about target directory

This commit is contained in:
pcpthm 2019-04-04 18:57:10 +09:00
parent c083515eec
commit 0010d62cad

View File

@ -126,10 +126,7 @@ mod tests {
#[test]
fn test_loading_rust_analyzer() {
let mut path = std::env::current_exe().unwrap();
while !path.join("Cargo.toml").is_file() {
path = path.parent().unwrap().to_owned();
}
let path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap();
let (db, roots) = BatchDatabase::load_cargo(path).unwrap();
let mut n_crates = 0;
for root in roots {