Skip to content

Commit

Permalink
[TEST] Add extension > filename test for code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
smehringer committed Jan 25, 2022
1 parent af4756f commit 877b5ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/unit/format_parse_validators_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ TEST(validator_test, output_file)
EXPECT_THROW(my_validator(no_extension), sharg::validation_error);
}

{ // filename is shorter than extension.
std::filesystem::path filename{tmp_name.get_path()};
std::vector<std::string> long_extension{"super_duper_long_extension_longer_than_seqan_tmp_filename"};
sharg::output_file_validator my_validator{sharg::output_file_open_options::create_new, long_extension};
EXPECT_THROW(my_validator(filename), sharg::validation_error);
}

{ // filename starts with dot.
sharg::output_file_validator my_validator{sharg::output_file_open_options::create_new, formats};
EXPECT_NO_THROW(my_validator(hidden_name.get_path()));
Expand Down

0 comments on commit 877b5ea

Please sign in to comment.