mdbook/examples/remove-emphasis/test.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
534 B
Rust
Raw Permalink Normal View History

//! A test to ensure that the remove-emphasis example works.
2024-11-02 15:41:55 -07:00
#[test]
fn remove_emphasis_works() {
// Tests that the remove-emphasis example works as expected.
// Workaround for https://github.com/rust-lang/mdBook/issues/1424
std::env::set_current_dir("examples/remove-emphasis").unwrap();
2025-07-21 21:42:58 -07:00
let book = mdbook_driver::MDBook::load(".").unwrap();
2024-11-02 15:41:55 -07:00
book.build().unwrap();
let ch1 = std::fs::read_to_string("book/chapter_1.html").unwrap();
assert!(ch1.contains("This has light emphasis and bold emphasis."));
}