mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Update test data for crate deduping
Make data reflect a case where dev deps are existent. base-db::CrateGraph::extend now adds dev dependencies for a crate in case of its upgrading from a CrateOrigin::Lib kind of a crate to a CrateOrigin::Local one.
This commit is contained in:
parent
25e990d753
commit
74d8fdc8fe
4 changed files with 162 additions and 41 deletions
|
@ -3,7 +3,7 @@ use std::{
|
|||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use base_db::{CrateGraph, FileId, ProcMacroPaths};
|
||||
use base_db::{CrateGraph, DependencyKind, FileId, ProcMacroPaths};
|
||||
use cfg::{CfgAtom, CfgDiff};
|
||||
use expect_test::{expect_file, ExpectFile};
|
||||
use paths::{AbsPath, AbsPathBuf};
|
||||
|
@ -272,7 +272,9 @@ fn test_deduplicate_crate_differing_in_origin() {
|
|||
}
|
||||
|
||||
assert!(crates_named_p1.len() == 1);
|
||||
assert!(crates_named_p1[0].origin.is_local());
|
||||
let p1 = crates_named_p1[0];
|
||||
assert!(p1.dependencies.iter().filter(|dep| dep.kind() == DependencyKind::Dev).count() == 1);
|
||||
assert!(p1.origin.is_local());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -297,5 +299,7 @@ fn test_deduplicate_crate_differing_in_origin_in_rev_resolution_order() {
|
|||
}
|
||||
|
||||
assert!(crates_named_p1.len() == 1);
|
||||
assert!(crates_named_p1[0].origin.is_local());
|
||||
let p1 = crates_named_p1[0];
|
||||
assert!(p1.dependencies.iter().filter(|dep| dep.kind() == DependencyKind::Dev).count() == 1);
|
||||
assert!(p1.origin.is_local());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue