@@ -5,7 +5,7 @@ use std::{
5
5
6
6
use base_db:: { CrateGraph , FileId , ProcMacroPaths } ;
7
7
use cfg:: { CfgAtom , CfgDiff } ;
8
- use expect_test:: { expect, Expect } ;
8
+ use expect_test:: { expect, expect_file , Expect , ExpectFile } ;
9
9
use paths:: { AbsPath , AbsPathBuf } ;
10
10
use serde:: de:: DeserializeOwned ;
11
11
@@ -114,6 +114,11 @@ fn check_crate_graph(crate_graph: CrateGraph, expect: Expect) {
114
114
replace_root ( & mut crate_graph, false ) ;
115
115
expect. assert_eq ( & crate_graph) ;
116
116
}
117
+ fn check_crate_graph_f ( crate_graph : CrateGraph , expect : ExpectFile ) {
118
+ let mut crate_graph = format ! ( "{crate_graph:#?}" ) ;
119
+ replace_root ( & mut crate_graph, false ) ;
120
+ expect. assert_eq ( & crate_graph) ;
121
+ }
117
122
118
123
#[ test]
119
124
fn cargo_hello_world_project_model_with_wildcard_overrides ( ) {
@@ -1800,3 +1805,12 @@ fn rust_project_is_proc_macro_has_proc_macro_dep() {
1800
1805
// on the proc_macro sysroot crate.
1801
1806
crate_data. dependencies . iter ( ) . find ( |& dep| dep. name . deref ( ) == "proc_macro" ) . unwrap ( ) ;
1802
1807
}
1808
+
1809
+ #[ test]
1810
+ fn cargo_dev_dependencies ( ) {
1811
+ let ( crate_graph, _proc_macros) = load_cargo ( "complex-with-dev-deps.json" ) ;
1812
+ check_crate_graph_f (
1813
+ crate_graph,
1814
+ expect_file ! [ "../test_data/cargo_dev_dependencies-crate-graph.txt" ] ,
1815
+ )
1816
+ }
0 commit comments