@@ -5,7 +5,7 @@ use std::{
55
66use base_db:: { CrateGraph , FileId , ProcMacroPaths } ;
77use cfg:: { CfgAtom , CfgDiff } ;
8- use expect_test:: { expect, Expect } ;
8+ use expect_test:: { expect, expect_file , Expect , ExpectFile } ;
99use paths:: { AbsPath , AbsPathBuf } ;
1010use serde:: de:: DeserializeOwned ;
1111
@@ -114,6 +114,11 @@ fn check_crate_graph(crate_graph: CrateGraph, expect: Expect) {
114114 replace_root ( & mut crate_graph, false ) ;
115115 expect. assert_eq ( & crate_graph) ;
116116}
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+ }
117122
118123#[ test]
119124fn cargo_hello_world_project_model_with_wildcard_overrides ( ) {
@@ -1800,3 +1805,12 @@ fn rust_project_is_proc_macro_has_proc_macro_dep() {
18001805 // on the proc_macro sysroot crate.
18011806 crate_data. dependencies . iter ( ) . find ( |& dep| dep. name . deref ( ) == "proc_macro" ) . unwrap ( ) ;
18021807}
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