8000 Let the tests of the published jetdb crate build without docs/lib.md by dominion525 · Pull Request #155 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions crates/jetdb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ pub use vba::{read_vba_project, read_vba_project_in, VbaModule, VbaModuleType, V
mod tests {
#[test]
fn docs_lib_md_is_the_crate_documentation() {
// docs/lib.md, read on GitHub, is a copy of lib_doc.md.
assert_eq!(
include_str!("../../../docs/lib.md"),
include_str!("lib_doc.md")
);
// docs/lib.md, read on GitHub, is a copy of lib_doc.md. It is outside
// the crate, so the published package has no docs/lib.md, and the
// test is skipped there.
let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../docs/lib.md");
let Ok(docs_lib_md) = std::fs::read_to_string(&path) else {
eprintln!("SKIP: docs/lib.md not found: {}", path.display());
return;
};
assert_eq!(docs_lib_md, include_str!("lib_doc.md"));
}
}
Loading
0