@@ -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 ( ) {
@@ -1666,3 +1671,12 @@ fn rust_project_is_proc_macro_has_proc_macro_dep() {
16661671 // on the proc_macro sysroot crate.
16671672 crate_data. dependencies . iter ( ) . find ( |& dep| dep. name . deref ( ) == "proc_macro" ) . unwrap ( ) ;
16681673}
1674+
1675+ #[ test]
1676+ fn cargo_dev_dependencies ( ) {
1677+ let ( crate_graph, _proc_macros) = load_cargo ( "complex-with-dev-deps.json" ) ;
1678+ check_crate_graph_f (
1679+ crate_graph,
1680+ expect_file ! [ "../test_data/cargo_dev_dependencies-crate-graph.txt" ] ,
1681+ )
1682+ }
0 commit comments