From 7247e5f9a1af38706a7c5d7204b9f2972ec927a7 Mon Sep 17 00:00:00 2001 From: Gabor Szabo Date: Mon, 31 Mar 2025 11:39:38 +0300 Subject: [PATCH] test the command line without any parameters #1568 --- tests/cli/test.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/cli/test.rs b/tests/cli/test.rs index 63114d3a..56e0f159 100644 --- a/tests/cli/test.rs +++ b/tests/cli/test.rs @@ -32,3 +32,15 @@ fn mdbook_cli_detects_book_with_failing_tests() { .stderr(predicates::str::is_match(r##"returned an error:\n\n"##).unwrap()) .stderr(predicates::str::is_match(r##"Nested_Chapter::Rustdoc_include_works_with_anchors_too \(line \d+\) ... FAILED"##).unwrap()); } + +#[test] +fn empty_cli() { + let mut cmd = mdbook_cmd(); + cmd.assert() + .failure() + .code(2) + .stdout(predicates::str::is_empty()) + .stderr(predicates::str::contains( + "Creates a book from markdown files", + )); +}