File tree Expand file tree Collapse file tree 5 files changed +18
-13
lines changed
theme/copy_fonts_false_with_empty_fonts_css Expand file tree Collapse file tree 5 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -323,19 +323,6 @@ fn custom_fonts() {
323
323
contents. contains ( "fonts/fonts.css" )
324
324
} ;
325
325
326
- // copy-fonts=false with empty fonts.css
327
- let temp = TempFileBuilder :: new ( ) . prefix ( "mdbook" ) . tempdir ( ) . unwrap ( ) ;
328
- let p = temp. path ( ) ;
329
- MDBook :: init ( p) . build ( ) . unwrap ( ) ;
330
- write_file ( & p. join ( "theme/fonts" ) , "fonts.css" , b"" ) . unwrap ( ) ;
331
- let config = Config :: from_str ( "output.html.copy-fonts = false" ) . unwrap ( ) ;
332
- MDBook :: load_with_config ( p, config)
333
- . unwrap ( )
334
- . build ( )
335
- . unwrap ( ) ;
336
- assert ! ( !has_fonts_css( p) ) ;
337
- assert ! ( !p. join( "book/fonts" ) . exists( ) ) ;
338
-
339
326
// copy-fonts=false with fonts theme
340
327
let temp = TempFileBuilder :: new ( ) . prefix ( "mdbook" ) . tempdir ( ) . unwrap ( ) ;
341
328
let p = temp. path ( ) ;
Original file line number Diff line number Diff line change @@ -155,3 +155,18 @@ Add an empty `theme/fonts/fonts.css` file to squelch this warning.
155
155
. check_file_doesnt_contain ( "book/index.html" , "fonts.css" )
156
156
. check_file_list ( "book/fonts" , str![ [ "" ] ] ) ;
157
157
}
158
+
159
+ // copy-fonts=false, empty fonts.css
160
+ #[ test]
161
+ fn copy_fonts_false_with_empty_fonts_css ( ) {
162
+ BookTest :: from_dir ( "theme/copy_fonts_false_with_empty_fonts_css" )
163
+ . run ( "build" , |cmd| {
164
+ cmd. expect_stderr ( str![ [ r#"
165
+ [TIMESTAMP] [INFO] (mdbook::book): Book building has started
166
+ [TIMESTAMP] [INFO] (mdbook::book): Running the html backend
167
+
168
+ "# ] ] ) ;
169
+ } )
170
+ . check_file_doesnt_contain ( "book/index.html" , "fonts.css" )
171
+ . check_file_list ( "book/fonts" , str![ [ "" ] ] ) ;
172
+ }
Original file line number Diff line number Diff line change
1
+ [output .html ]
2
+ copy-fonts = false
Original file line number Diff line number Diff line change
1
+ - [ Intro] ( index.md )
You can’t perform that action at this time.
0 commit comments