@@ -757,7 +757,7 @@ pub(crate) struct BuildResult {
757757#[ cfg( test) ]
758758mod tests {
759759 use super :: * ;
760- use crate :: test:: wrapper;
760+ use crate :: test:: { assert_redirect , assert_success , wrapper} ;
761761
762762 #[ test]
763763 #[ ignore]
@@ -816,19 +816,28 @@ mod tests {
816816 ) ;
817817
818818 let storage = env. storage ( ) ;
819+ let web = env. frontend ( ) ;
820+
819821 let base = format ! ( "rustdoc/{}/{}" , crate_, version) ;
820822
821- // default target was built
823+ // default target was built and is accessible
822824 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) ?;
823827
824828 // other targets too
825829 for target in DEFAULT_TARGETS {
826830 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+
828835 if target == & default_target {
829836 assert ! ( !target_docs_present) ;
837+ assert_redirect ( & target_url, & default_target_url, web) ?;
830838 } else {
831839 assert ! ( target_docs_present) ;
840+ assert_success ( & target_url, web) ?;
832841 }
833842 }
834843
0 commit comments