@@ -6,7 +6,7 @@ use std::io::{Read, Write};
6
6
use std:: fs:: File ;
7
7
8
8
use cargotest:: sleep_ms;
9
- use cargotest:: support:: { project, execs} ;
9
+ use cargotest:: support:: { project, execs, git } ;
10
10
use cargotest:: support:: registry:: Package ;
11
11
use hamcrest:: { assert_that, existing_file, existing_dir, is_not} ;
12
12
@@ -877,3 +877,36 @@ fn rebuild_please() {
877
877
assert_that ( p. cargo ( "run" ) . cwd ( p. root ( ) . join ( "bin" ) ) ,
878
878
execs ( ) . with_status ( 101 ) ) ;
879
879
}
880
+
881
+ #[ test]
882
+ fn workspace_in_git ( ) {
883
+ let git_project = git:: new ( "dep1" , |project| {
884
+ project
885
+ . file ( "Cargo.toml" , r#"
886
+ [workspace]
887
+ members = ["foo"]
888
+ "# )
889
+ . file ( "foo/Cargo.toml" , r#"
890
+ [package]
891
+ name = "foo"
892
+ version = "0.1.0"
893
+ "# )
894
+ . file ( "foo/src/lib.rs" , "" )
895
+ } ) . unwrap ( ) ;
896
+ let p = project ( "foo" )
897
+ . file ( "Cargo.toml" , & format ! ( r#"
898
+ [package]
899
+ name = "lib"
900
+ version = "0.1.0"
901
+
902
+ [dependencies.foo]
903
+ git = '{}'
904
+ "# , git_project. url( ) ) )
905
+ . file ( "src/lib.rs" , r#"
906
+ pub fn foo() -> u32 { 0 }
907
+ "# ) ;
908
+ p. build ( ) ;
909
+
910
+ assert_that ( p. cargo ( "build" ) ,
911
+ execs ( ) . with_status ( 0 ) ) ;
912
+ }
0 commit comments