File tree 1 file changed +47
-0
lines changed
1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -558,3 +558,50 @@ fn can_build_external_reexported_contracts() {
558
558
]
559
559
) ;
560
560
}
561
+ #[ test]
562
+ fn can_dedup_contract_reexports ( ) {
563
+ let t = TempDir :: new ( ) . unwrap ( ) ;
564
+ let hello = t. child ( "hello" ) ;
565
+ let world = t. child ( "world" ) ;
566
+
567
+ ProjectBuilder :: start ( )
568
+ . name ( "hello" )
569
+ . version ( "0.1.0" )
570
+ . manifest_extra ( indoc ! { r#"
571
+ [lib]
572
+ [[target.starknet-contract]]
573
+ "# } )
574
+ . dep_starknet ( )
575
+ . lib_cairo ( "pub mod a; pub use a::Balance;" )
576
+ . src ( "src/a.cairo" , BALANCE_CONTRACT )
577
+ . build ( & hello) ;
578
+
579
+ ProjectBuilder :: start ( )
580
+ . name ( "world" )
581
+ . version ( "0.1.0" )
582
+ . dep ( "hello" , hello)
583
+ . manifest_extra ( formatdoc ! { r#"
584
+ [[target.starknet-contract]]
585
+ build-external-contracts = ["hello::*"]
586
+ "# } )
587
+ . dep_starknet ( )
588
+ . build ( & world) ;
589
+
590
+ Scarb :: quick_snapbox ( )
591
+ . arg ( "build" )
592
+ . current_dir ( & world)
593
+ . assert ( )
594
+ . success ( )
595
+ . stdout_matches ( indoc ! { r#"
596
+ [..] Compiling world v0.1.0 ([..]/Scarb.toml)
597
+ [..] Finished `dev` profile target(s) in [..]
598
+ "# } ) ;
599
+
600
+ assert_eq ! (
601
+ world. child( "target/dev" ) . files( ) ,
602
+ vec![
603
+ "world.starknet_artifacts.json" ,
604
+ "world_Balance.contract_class.json" ,
605
+ ]
606
+ ) ;
607
+ }
You can’t perform that action at this time.
0 commit comments