@@ -313,6 +313,72 @@ fn dev_deps_are_not_propagated() {
313
313
) ;
314
314
}
315
315
316
+ #[ test]
317
+ fn dev_deps_are_not_propagated_for_ws_members ( ) {
318
+ let t = assert_fs:: TempDir :: new ( ) . unwrap ( ) ;
319
+
320
+ let dep1 = t. child ( "dep1" ) ;
321
+ ProjectBuilder :: start ( )
322
+ . name ( "dep1" )
323
+ . dep_cairo_test ( )
324
+ . build ( & dep1) ;
325
+
326
+ let dep2 = t. child ( "dep2" ) ;
327
+ ProjectBuilder :: start ( )
328
+ . name ( "dep2" )
329
+ . dep_cairo_test ( )
330
+ . dev_dep ( "dep1" , & dep1)
331
+ . build ( & dep2) ;
332
+
333
+ let pkg = t. child ( "pkg" ) ;
334
+ ProjectBuilder :: start ( )
335
+ . name ( "x" )
336
+ . dep_cairo_test ( )
337
+ . dep ( "dep2" , & dep2)
338
+ . build ( & pkg) ;
339
+
340
+ WorkspaceBuilder :: start ( )
341
+ . add_member ( "dep2" )
342
+ . add_member ( "pkg" )
343
+ . build ( & t) ;
344
+
345
+ let metadata = Scarb :: quick_snapbox ( )
346
+ . arg ( "--json" )
347
+ . arg ( "metadata" )
348
+ . arg ( "--format-version" )
349
+ . arg ( "1" )
350
+ . current_dir ( & t)
351
+ . stdout_json :: < Metadata > ( ) ;
352
+
353
+ assert_eq ! (
354
+ units_and_components( metadata) ,
355
+ BTreeMap :: from_iter( vec![
356
+ (
357
+ "dep2" . to_string( ) ,
358
+ vec![ "core" . to_string( ) , "dep2" . to_string( ) ]
359
+ ) ,
360
+ (
361
+ "dep2_unittest" . to_string( ) ,
362
+ vec![ "core" . to_string( ) , "dep1" . to_string( ) , "dep2" . to_string( ) ]
363
+ ) ,
364
+ (
365
+ "x" . to_string( ) ,
366
+ vec![ "core" . to_string( ) , "dep2" . to_string( ) , "x" . to_string( ) ]
367
+ ) ,
368
+ (
369
+ "x_unittest" . to_string( ) ,
370
+ vec![
371
+ "core" . to_string( ) ,
372
+ // With dev-deps propagation enabled, this would be included
373
+ // "dep1".to_string(),
374
+ "dep2" . to_string( ) ,
375
+ "x" . to_string( )
376
+ ]
377
+ ) ,
378
+ ] )
379
+ ) ;
380
+ }
381
+
316
382
#[ test]
317
383
fn no_dep ( ) {
318
384
let t = assert_fs:: TempDir :: new ( ) . unwrap ( ) ;
0 commit comments