mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-11-10 23:30:57 +00:00
29 lines
670 B
Rust
29 lines
670 B
Rust
//! Syntax checking for manpages.
|
|
#![cfg(feature = "nix_tests")]
|
|
|
|
use assert_cmd::Command;
|
|
|
|
use std::fs;
|
|
|
|
#[test]
|
|
fn mandoc_lint() {
|
|
let paths = fs::read_dir("man")
|
|
.unwrap()
|
|
.filter_map(|entry| {
|
|
let path = entry.unwrap().path();
|
|
if path.is_file() && path.extension() == Some("1".as_ref()) {
|
|
Some(path.to_str().unwrap().to_string())
|
|
} else {
|
|
None
|
|
}
|
|
})
|
|
.collect::<Vec<_>>();
|
|
Command::new("mandoc")
|
|
.args(&["-man", "-Wall", "-Tlint", "--"])
|
|
.args(&paths)
|
|
.assert()
|
|
.success()
|
|
.stdout("")
|
|
.stderr("");
|
|
}
|