@@ -32,21 +32,10 @@ fn basic_project() -> Project {
3232 . build ( )
3333}
3434
35- fn docs_rs ( p : & Project ) {
36- p. change_file (
37- ".cargo/config" ,
38- r#"
39- [doc.extern-map.registries]
40- crates-io = "https://docs.rs/"
41- "# ,
42- ) ;
43- }
44-
4535#[ cargo_test]
4636fn ignores_on_stable ( ) {
4737 // Requires -Zrustdoc-map to use.
4838 let p = basic_project ( ) ;
49- docs_rs ( & p) ;
5039 p. cargo ( "doc -v --no-deps" )
5140 . with_stderr_does_not_contain ( "[..]--extern-html-root-url[..]" )
5241 . run ( ) ;
@@ -60,7 +49,6 @@ fn simple() {
6049 return ;
6150 }
6251 let p = basic_project ( ) ;
63- docs_rs ( & p) ;
6452 p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
6553 . masquerade_as_nightly_cargo ( )
6654 . with_stderr_contains (
@@ -157,7 +145,6 @@ fn renamed_dep() {
157145 "# ,
158146 )
159147 . build ( ) ;
160- docs_rs ( & p) ;
161148 p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
162149 . masquerade_as_nightly_cargo ( )
163150 . with_stderr_contains (
@@ -211,7 +198,6 @@ fn lib_name() {
211198 "# ,
212199 )
213200 . build ( ) ;
214- docs_rs ( & p) ;
215201 p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
216202 . masquerade_as_nightly_cargo ( )
217203 . with_stderr_contains (
@@ -338,7 +324,6 @@ fn multiple_versions() {
338324 " ,
339325 )
340326 . build ( ) ;
341- docs_rs ( & p) ;
342327 p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
343328 . masquerade_as_nightly_cargo ( )
344329 . with_stderr_contains (
@@ -364,12 +349,21 @@ fn rebuilds_when_changing() {
364349 let p = basic_project ( ) ;
365350 p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
366351 . masquerade_as_nightly_cargo ( )
367- . with_stderr_does_not_contain ( "[..]--extern-html-root-url[..]" )
352+ . with_stderr_contains ( "[..]--extern-html-root-url[..]" )
368353 . run ( ) ;
369354
370- docs_rs ( & p) ;
355+ // This also tests that the map for docs.rs can be overridden.
356+ p. change_file (
357+ ".cargo/config" ,
358+ r#"
359+ [doc.extern-map.registries]
360+ crates-io = "https://example.com/"
361+ "# ,
362+ ) ;
371363 p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
372364 . masquerade_as_nightly_cargo ( )
373- . with_stderr_contains ( "[..]--extern-html-root-url[..]" )
365+ . with_stderr_contains (
366+ "[RUNNING] `rustdoc [..]--extern-html-root-url 'bar=https://example.com/bar/1.0.0/[..]' [..]" ,
367+ )
374368 . run ( ) ;
375369}
0 commit comments