File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -1587,3 +1587,57 @@ fn install_yanked_cargo_package() {
1587
1587
)
1588
1588
. run ( ) ;
1589
1589
}
1590
+
1591
+ #[ cargo_test]
1592
+ fn install_cargo_package_in_a_patched_workspace ( ) {
1593
+ pkg ( "foo" , "0.1.0" ) ;
1594
+ pkg ( "fizz" , "1.0.0" ) ;
1595
+
1596
+ let p = project ( )
1597
+ . file (
1598
+ "Cargo.toml" ,
1599
+ r#"
1600
+ [package]
1601
+ name = "bar"
1602
+ version = "0.1.0"
1603
+ authors = []
1604
+
1605
+ [workspace]
1606
+ members = ["baz"]
1607
+ "# ,
1608
+ )
1609
+ . file ( "src/main.rs" , "fn main() {}" )
1610
+ . file (
1611
+ "baz/Cargo.toml" ,
1612
+ r#"
1613
+ [package]
1614
+ name = "baz"
1615
+ version = "0.1.0"
1616
+ authors = []
1617
+
1618
+ [dependencies]
1619
+ fizz = "1"
1620
+
1621
+ [patch.crates-io]
1622
+ fizz = { version = "=1.0.0" }
1623
+ "# ,
1624
+ )
1625
+ . file ( "baz/src/lib.rs" , "" )
1626
+ . build ( ) ;
1627
+
1628
+ let stderr = "\
1629
+ [WARNING] patch for the non root package will be ignored, specify patch at the workspace root:
1630
+ package: [..]/foo/baz/Cargo.toml
1631
+ workspace: [..]/foo/Cargo.toml
1632
+ " ;
1633
+ p. cargo ( "check" )
1634
+ . with_stderr_contains ( & stderr)
1635
+ . run ( ) ;
1636
+
1637
+ // A crate installation must not emit any message from a workspace under
1638
+ // current working directory.
1639
+ // See https://github.com/rust-lang/cargo/issues/8619
1640
+ p. cargo ( "install foo" )
1641
+ . with_stderr_does_not_contain ( & stderr)
1642
+ . run ( ) ;
1643
+ }
You can’t perform that action at this time.
0 commit comments