mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-08 03:49:44 -04:00
test: add test for failing to open input list file
This commit is contained in:
parent
3e1d69ea2a
commit
e9688b7306
@ -765,7 +765,7 @@ int mkdwarfs_main(int argc, sys_char** argv, iolayer const& iol) {
|
|||||||
ifs = iol.file->open_input(input_list_path, ec);
|
ifs = iol.file->open_input(input_list_path, ec);
|
||||||
|
|
||||||
if (ec) {
|
if (ec) {
|
||||||
iol.err << "error opening file '" << input_list_path
|
iol.err << "cannot open input list file '" << input_list_path
|
||||||
<< "': " << ec.message() << "\n";
|
<< "': " << ec.message() << "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -552,3 +552,9 @@ TEST(mkdwarfs_test, cannot_combine_input_list_and_filter) {
|
|||||||
EXPECT_THAT(t.err(),
|
EXPECT_THAT(t.err(),
|
||||||
::testing::HasSubstr("cannot combine --input-list and --filter"));
|
::testing::HasSubstr("cannot combine --input-list and --filter"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(mkdwarfs_test, cannot_open_input_list_file) {
|
||||||
|
mkdwarfs_tester t;
|
||||||
|
EXPECT_NE(0, t.run({"--input-list", "missing.list", "-o", "-"}));
|
||||||
|
EXPECT_THAT(t.err(), ::testing::HasSubstr("cannot open input list file"));
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user