From 205c2f6630f500ffc26c7b33ce154ec655546e47 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Fri, 5 Jan 2024 00:00:16 +0100 Subject: [PATCH] test(mkdwarfs): add more metadata requirements tests --- test/tool_main_test.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/tool_main_test.cpp b/test/tool_main_test.cpp index fe8a1cb0..e5f9b362 100644 --- a/test/tool_main_test.cpp +++ b/test/tool_main_test.cpp @@ -1081,9 +1081,18 @@ TEST(mkdwarfs_test, output_file_fail_close) { EXPECT_THAT(t.err(), ::testing::HasSubstr("failed to close output file")); } -TEST(mkdwarfs_test, compression_cannot_be_used) { +TEST(mkdwarfs_test, compression_cannot_be_used_without_category) { mkdwarfs_tester t; EXPECT_NE(0, t.run({"-i", "/", "-o", "-", "-C", "flac"})); EXPECT_THAT(t.err(), ::testing::HasSubstr("cannot be used without a category")); } + +TEST(mkdwarfs_test, compression_cannot_be_used_for_category) { + mkdwarfs_tester t; + EXPECT_NE(0, t.run({"-i", "/", "-o", "-", "--categorize", "-C", + "incompressible::flac"})); + EXPECT_THAT(t.err(), ::testing::HasSubstr( + "cannot be used for category 'incompressible': " + "metadata requirements not met")); +}