From 7fd51fb80cec92d076c3adad74195545cfce96f1 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Mon, 1 Jan 2024 16:19:39 +0100 Subject: [PATCH] test: cannot combine --input-list and --filter --- src/mkdwarfs_main.cpp | 2 +- test/tool_main_test.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mkdwarfs_main.cpp b/src/mkdwarfs_main.cpp index a8efe334..b29e2e89 100644 --- a/src/mkdwarfs_main.cpp +++ b/src/mkdwarfs_main.cpp @@ -742,7 +742,7 @@ int mkdwarfs_main(int argc, sys_char** argv, iolayer const& iol) { if (vm.count("input-list")) { if (vm.count("filter")) { - iol.err << "error: cannot use --input-list and --filter\n"; + iol.err << "error: cannot combine --input-list and --filter\n"; return 1; } diff --git a/test/tool_main_test.cpp b/test/tool_main_test.cpp index cf561681..47a894d6 100644 --- a/test/tool_main_test.cpp +++ b/test/tool_main_test.cpp @@ -545,3 +545,10 @@ TEST(mkdwarfs_test, block_size_too_large) { EXPECT_NE(0, t.run({"-i", "/", "-o", "-", "-S", "100"})); EXPECT_THAT(t.err(), ::testing::HasSubstr("block size must be between")); } + +TEST(mkdwarfs_test, cannot_combine_input_list_and_filter) { + auto t = mkdwarfs_tester::create_empty(); + EXPECT_NE(0, t.run({"--input-list", "-", "-o", "-", "-F", "+ *"})); + EXPECT_THAT(t.err(), + ::testing::HasSubstr("cannot combine --input-list and --filter")); +}