@@ -757,7 +757,7 @@ pub(crate) struct BuildResult {
757
757
#[ cfg( test) ]
758
758
mod tests {
759
759
use super :: * ;
760
- use crate :: test:: wrapper;
760
+ use crate :: test:: { assert_redirect , assert_success , wrapper} ;
761
761
762
762
#[ test]
763
763
#[ ignore]
@@ -816,19 +816,28 @@ mod tests {
816
816
) ;
817
817
818
818
let storage = env. storage ( ) ;
819
+ let web = env. frontend ( ) ;
820
+
819
821
let base = format ! ( "rustdoc/{}/{}" , crate_, version) ;
820
822
821
- // default target was built
823
+ // default target was built and is accessible
822
824
assert ! ( storage. exists( & format!( "{}/{}/index.html" , base, crate_) ) ?) ;
825
+ let default_target_url = format ! ( "/{0}/{1}/{0}" , crate_, version) ;
826
+ assert_success ( & default_target_url, web) ?;
823
827
824
828
// other targets too
825
829
for target in DEFAULT_TARGETS {
826
830
let target_docs_present =
827
- storage. exists ( & format ! ( "{}/{}/{}/index.html" , base, crate_, target) ) ?;
831
+ storage. exists ( & format ! ( "{}/{}/{}/index.html" , base, target, crate_) ) ?;
832
+
833
+ let target_url = format ! ( "/{0}/{1}/{2}/{0}/index.html" , crate_, version, target) ;
834
+
828
835
if target == & default_target {
829
836
assert ! ( !target_docs_present) ;
837
+ assert_redirect ( & target_url, & default_target_url, web) ?;
830
838
} else {
831
839
assert ! ( target_docs_present) ;
840
+ assert_success ( & target_url, web) ?;
832
841
}
833
842
}
834
843
0 commit comments