d02f7c3aa5
* Removed a lot of clutter, unified some code * Started using syn::parse::Parse for pyfunction attributes * No more newlines between imports * Renamed `#[prop(get, set)]` to `#[pyo3(get, set)]` * `#[pyfunction]` now supports the same arguments as `#[pyfn()]` * Some macros now emit proper spanned errors instead of panics.
31 lines
647 B
Rust
31 lines
647 B
Rust
use docmatic;
|
|
use std::default::Default;
|
|
use std::path::{Path, PathBuf};
|
|
|
|
fn assert_file<P: AsRef<Path>>(path: P) {
|
|
let mut doc = docmatic::Assert::default();
|
|
if cfg!(windows) {
|
|
doc.library_path(
|
|
option_env!("PYTHON")
|
|
.map(|py| PathBuf::from(py).join("libs"))
|
|
.unwrap(),
|
|
);
|
|
}
|
|
doc.test_file(path.as_ref())
|
|
}
|
|
|
|
#[ignore]
|
|
#[test]
|
|
fn test_guide() {
|
|
let guide_path = PathBuf::from("guide").join("src");
|
|
for entry in guide_path.read_dir().unwrap() {
|
|
assert_file(entry.unwrap().path())
|
|
}
|
|
}
|
|
|
|
#[ignore]
|
|
#[test]
|
|
fn test_readme() {
|
|
assert_file("README.md")
|
|
}
|