File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -2165,4 +2165,35 @@ mod tests {
2165
2165
Ok ( ( ) )
2166
2166
} )
2167
2167
}
2168
+
2169
+ #[ test]
2170
+ fn test_sizes_display ( ) {
2171
+ wrapper ( |env| {
2172
+ env. fake_release ( )
2173
+ . name ( "dummy" )
2174
+ . version ( "0.4.0" )
2175
+ . rustdoc_file ( "dummy/index.html" )
2176
+ . create ( ) ?;
2177
+
2178
+ let response = env. frontend ( ) . get ( "/crate/dummy/0.4.0" ) . send ( ) ?;
2179
+ assert ! ( response. status( ) . is_success( ) ) ;
2180
+
2181
+ let mut has_source_code_size = false ;
2182
+ let mut has_doc_size = false ;
2183
+ for span in kuchikiki:: parse_html ( )
2184
+ . one ( response. text ( ) ?)
2185
+ . select ( r#".pure-menu-item span.documented-info"# )
2186
+ . expect ( "invalid selector" )
2187
+ {
2188
+ if span. text_contents ( ) . starts_with ( "Source code size:" ) {
2189
+ has_source_code_size = true ;
2190
+ } else if span. text_contents ( ) . starts_with ( "Documentation size:" ) {
2191
+ has_doc_size = true ;
2192
+ }
2193
+ }
2194
+ assert ! ( has_source_code_size) ;
2195
+ assert ! ( has_doc_size) ;
2196
+ Ok ( ( ) )
2197
+ } ) ;
2198
+ }
2168
2199
}
You can’t perform that action at this time.
0 commit comments