Skip to content

Commit 3b34648

Browse files
committed
Add a test for the clap args.
See: clap-rs/clap#6174 (comment)
1 parent 252ee90 commit 3b34648

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ format:
1212
cargo clippy
1313
cargo fmt
1414

15-
.PHONY: test
15+
.PHONY: cargo-test test
1616
test: test-behaviour lint check-readme-cli-help
1717

18+
.PHONY: cargo-test
19+
cargo-test:
20+
cargo test
21+
1822
.PHONY: test-behaviour
1923
test-behaviour:
2024
./test/test-behaviour.sh

src/args.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,3 +329,16 @@ fn current_macOS_version() -> String {
329329

330330
stdout.to_owned()
331331
}
332+
333+
#[cfg(test)]
334+
mod tests {
335+
use crate::args::FolderifyArgs;
336+
337+
// https://docs.rs/clap/latest/clap/_derive/_tutorial/index.html#testing
338+
#[test]
339+
fn test_clap_args() {
340+
use clap::CommandFactory;
341+
342+
FolderifyArgs::command().debug_assert();
343+
}
344+
}

0 commit comments

Comments
 (0)