File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -1566,3 +1566,47 @@ fn run_link_system_path_macos() {
1566
1566
p2. cargo ( "run" ) . env ( VAR , & libdir) . run ( ) ;
1567
1567
p2. cargo ( "test" ) . env ( VAR , & libdir) . run ( ) ;
1568
1568
}
1569
+
1570
+ #[ cargo_test]
1571
+ fn run_binary_with_same_name_as_dependency ( ) {
1572
+ let p = project ( )
1573
+ . file (
1574
+ "Cargo.toml" ,
1575
+ r#"
1576
+ [package]
1577
+ name = "foo"
1578
+ version = "0.5.0"
1579
+ authors = []
1580
+
1581
+ [dependencies]
1582
+ foo = { path = "foo" }
1583
+ "# ,
1584
+ )
1585
+ . file (
1586
+ "src/main.rs" ,
1587
+ r#"
1588
+ fn main() {}
1589
+ "# ,
1590
+ )
1591
+ . file (
1592
+ "foo/Cargo.toml" ,
1593
+ r#"
1594
+ [package]
1595
+ name = "foo"
1596
+ version = "0.1.0"
1597
+ authors = []
1598
+
1599
+ [lib]
1600
+ name = "foo"
1601
+ path = "foo.rs"
1602
+ "# ,
1603
+ )
1604
+ . file ( "foo/foo.rs" , "" )
1605
+ . build ( ) ;
1606
+
1607
+ p. cargo ( "run" ) . run ( ) ;
1608
+ p. cargo ( "run -p foo@0.5.0" )
1609
+ . with_status ( 101 )
1610
+ . with_stderr ( "[ERROR] package(s) `foo@0.5.0` not found in workspace [..]" )
1611
+ . run ( ) ;
1612
+ }
You can’t perform that action at this time.
0 commit comments