1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-05 22:53:52 +00:00

Adding a test for coverage

This commit is contained in:
Henry Fredrick Schreiner 2018-04-11 20:59:37 +02:00 committed by Henry Schreiner
parent 067bb43a84
commit b17f7ce63a
2 changed files with 11 additions and 10 deletions

View File

@ -9,13 +9,12 @@ format_file() {
file="${1}"
case "$file" in
*.hpp | *.cpp | .c | *.cc | *.cu | *.h )
echo "Formatting: $file"
clang-format -i -style=file -sort-includes "${1}"
if git diff-file --quiet -- "${1}" ; then
if git diff-files --quiet -- "${1}" ; then
echo "Already formatted: ${1}"
else
git add "${1}"
echo "Reformatting file: ${1}"
else
echo "Already formatted: ${1}"
fi;
;;
*)

View File

@ -331,13 +331,15 @@ TEST_F(TApp, OptionFromDefaultsSubcommands) {
EXPECT_EQ(app2->option_defaults()->get_group(), "Something");
}
TEST_F(TApp, HelpFlagFromDefaultsSubcommands) {
app.set_help_flag("--that", "Wow");
TEST_F(TApp, GetNameCheck) {
int x;
auto a = app.add_flag("--that");
auto b = app.add_flag("-x");
auto c = app.add_option("pos", x);
auto app2 = app.add_subcommand("app2");
EXPECT_EQ(app2->get_help_ptr()->get_name(), "--that");
EXPECT_EQ(app2->get_help_ptr()->get_description(), "Wow");
EXPECT_EQ(a->get_name(), "--that");
EXPECT_EQ(b->get_name(), "-x");
EXPECT_EQ(c->get_name(), "pos");
}
TEST_F(TApp, SubcommandDefaults) {