File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed
Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -84,11 +84,13 @@ fn builder_interface() {
8484
8585#[ test]
8686fn error1 ( ) {
87+ let manifest_path = current_dir ( ) . unwrap ( ) . join ( "foo" ) ;
88+ let error = "error: the manifest-path must be a path to a Cargo.toml file" ;
89+ let error_with_path = format ! ( "{error}: `{}`" , manifest_path. display( ) ) ;
8790 match MetadataCommand :: new ( ) . manifest_path ( "foo" ) . exec ( ) {
88- Err ( Error :: CargoMetadata { stderr } ) => assert_eq ! (
89- stderr. trim( ) ,
90- "error: the manifest-path must be a path to a Cargo.toml file"
91- ) ,
91+ Err ( Error :: CargoMetadata { stderr } ) => {
92+ assert ! ( [ error, & error_with_path] . contains( & stderr. trim( ) ) )
93+ }
9294 _ => unreachable ! ( ) ,
9395 }
9496}
@@ -181,23 +183,11 @@ fn workspace_default_packages() {
181183#[ test]
182184#[ cfg( feature = "unstable" ) ]
183185fn build_dir ( ) {
184- let metadata = MetadataCommand :: new ( )
185- . no_deps ( )
186- . other_options ( [ "-Zbuild-dir" ] . map ( str:: to_string) )
187- . exec ( )
188- . unwrap ( ) ;
186+ let metadata = MetadataCommand :: new ( ) . no_deps ( ) . exec ( ) . unwrap ( ) ;
189187
190188 assert ! ( & metadata. build_directory. is_some( ) ) ;
191189 assert ! ( & metadata
192190 . build_directory
193191 . unwrap( )
194192 . ends_with( "cargo_metadata/target" ) ) ;
195193}
196-
197- #[ test]
198- #[ cfg( feature = "unstable" ) ]
199- fn build_dir_disabled ( ) {
200- let metadata = MetadataCommand :: new ( ) . no_deps ( ) . exec ( ) . unwrap ( ) ;
201-
202- assert ! ( & metadata. build_directory. is_none( ) ) ;
203- }
You can’t perform that action at this time.
0 commit comments