File tree 1 file changed +68
-1
lines changed
1 file changed +68
-1
lines changed Original file line number Diff line number Diff line change @@ -3038,7 +3038,7 @@ foo v0.0.0 ([ROOT]/foo)
3038
3038
}
3039
3039
3040
3040
#[ cargo_test]
3041
- fn patch_with_base ( ) {
3041
+ fn patch_in_real_with_base ( ) {
3042
3042
let bar = project ( )
3043
3043
. at ( "bar" )
3044
3044
. file ( "Cargo.toml" , & basic_manifest ( "bar" , "0.5.0" ) )
@@ -3087,3 +3087,70 @@ foo v0.5.0 ([ROOT]/foo)
3087
3087
"# ] ] )
3088
3088
. run ( ) ;
3089
3089
}
3090
+
3091
+ #[ cargo_test]
3092
+ fn patch_in_virtual_with_base ( ) {
3093
+ let bar = project ( )
3094
+ . at ( "bar" )
3095
+ . file ( "Cargo.toml" , & basic_manifest ( "bar" , "0.5.0" ) )
3096
+ . file ( "src/lib.rs" , "pub fn hello() {}" )
3097
+ . build ( ) ;
3098
+ Package :: new ( "bar" , "0.5.0" ) . publish ( ) ;
3099
+
3100
+ let p = project ( )
3101
+ . file (
3102
+ ".cargo/config.toml" ,
3103
+ & format ! (
3104
+ r#"
3105
+ [path-bases]
3106
+ test = '{}'
3107
+ "# ,
3108
+ bar. root( ) . parent( ) . unwrap( ) . display( )
3109
+ ) ,
3110
+ )
3111
+ . file (
3112
+ "Cargo.toml" ,
3113
+ r#"
3114
+ cargo-features = ["path-bases"]
3115
+
3116
+ [workspace]
3117
+ members = ["foo"]
3118
+
3119
+ [patch.crates-io]
3120
+ bar = { base = 'test', path = 'bar' }
3121
+ "# ,
3122
+ )
3123
+ . file (
3124
+ "foo/Cargo.toml" ,
3125
+ r#"
3126
+ [package]
3127
+ name = "foo"
3128
+ version = "0.5.0"
3129
+
3130
+ edition = "2018"
3131
+
3132
+ [dependencies]
3133
+ bar = "0.5.0"
3134
+ "# ,
3135
+ )
3136
+ . file ( "foo/src/lib.rs" , "use bar::hello as _;" )
3137
+ . build ( ) ;
3138
+
3139
+ p. cargo ( "tree" )
3140
+ . masquerade_as_nightly_cargo ( & [ "path-bases" ] )
3141
+ . with_status ( 101 )
3142
+ . with_stderr_data ( str![ [ r#"
3143
+ [ERROR] failed to load source for dependency `bar`
3144
+
3145
+ Caused by:
3146
+ Unable to update [ROOT]/foo/bar
3147
+
3148
+ Caused by:
3149
+ failed to read `[ROOT]/foo/bar/Cargo.toml`
3150
+
3151
+ Caused by:
3152
+ [NOT_FOUND]
3153
+
3154
+ "# ] ] )
3155
+ . run ( ) ;
3156
+ }
You can’t perform that action at this time.
0 commit comments