Skip to content

Commit 463ec1a

Browse files
committed
Fix test cases
1 parent 806d2a9 commit 463ec1a

File tree

7 files changed

+210
-14
lines changed

7 files changed

+210
-14
lines changed

Cargo.lock

Lines changed: 180 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,20 @@ description = "Creates a book from markdown files"
1717
rust-version = "1.74"
1818
build = "build.rs"
1919

20-
[build-dependencies]
21-
syntect = { version = "5.1.0" }
20+
[build-dependencies.syntect]
21+
version = "5.1.0"
22+
default-features = false
23+
features = [
24+
# regex-onig, the default, isn't portable enough
25+
"regex-fancy",
26+
"parsing",
27+
"default-syntaxes",
28+
"default-themes",
29+
"html",
30+
"yaml-load",
31+
"dump-load",
32+
"dump-create",
33+
]
2234

2335
[dependencies]
2436
anyhow = "1.0.71"
@@ -67,7 +79,7 @@ walkdir = "2.3.3"
6779

6880
[features]
6981
default = ["watch", "serve", "search", "gen-syntax-cache"]
70-
watch = ["dep:notify", "dep:notify-debouncer-mini", "dep:ignore"]
82+
watch = ["dep:notify", "dep:notify-debouncer-mini", "dep:ignore", "dep:pathdiff", "dep:walkdir"]
7183
serve = ["dep:futures-util", "dep:tokio", "dep:warp"]
7284
search = ["dep:elasticlunr-rs", "dep:ammonia"]
7385
gen-syntax-cache = ["syntect/dump-create"]
@@ -79,3 +91,7 @@ name = "mdbook"
7991
[[example]]
8092
name = "nop-preprocessor"
8193
test = true
94+
95+
[profile.dev]
96+
opt-level = 1
97+

src/cmd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
33
pub mod build;
44
pub mod clean;
5+
pub mod command_prelude;
56
#[cfg(feature = "gen-syntax-cache")]
67
pub mod gen_syntax_cache;
7-
pub mod command_prelude;
88
pub mod init;
99
#[cfg(feature = "serve")]
1010
pub mod serve;

src/renderer/html_handlebars/hbs_renderer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ impl Renderer for HtmlHandlebars {
547547
None => ctx.root.join("theme"),
548548
};
549549

550-
let theme = theme::Theme::new(theme_dir);
550+
let theme = theme::Theme::new(theme_dir.clone());
551551

552552
debug!("Collect syntaxes into a syntax set");
553553
self.build_syntaxset(&theme, &theme_dir);

src/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl<'a> SyntaxHighlighter<'a> {
372372
)))
373373
}
374374
}
375-
Event::End(Tag::CodeBlock(CodeBlockKind::Fenced(_))) => {
375+
Event::End(TagEnd::CodeBlock) => {
376376
self.highlight = false;
377377
self.is_rust = false;
378378
self.syntax = None;

tests/rendered_output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ mod search {
853853
// Setting this to `true` may cause issues with `cargo watch`,
854854
// since it may not finish writing the fixture before the tests
855855
// are run again.
856-
const GENERATE_FIXTURE: bool = true;
856+
const GENERATE_FIXTURE: bool = false;
857857

858858
fn get_fixture() -> serde_json::Value {
859859
if GENERATE_FIXTURE {

0 commit comments

Comments
 (0)