From 3a2c5112a35ae51021bc6e70d9b1caa19bace7ff Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Thu, 3 Jan 2019 13:12:48 +0100 Subject: [PATCH] Adding missing tests from #185, should hit full coverage again --- extern/json | 2 +- tests/CreationTest.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/extern/json b/extern/json index f1768a54..db53bdac 160000 --- a/extern/json +++ b/extern/json @@ -1 +1 @@ -Subproject commit f1768a540a7b7c5cc30cdcd6be9e9ef91083719b +Subproject commit db53bdac1926d1baebcb459b685dcd2e4608c355 diff --git a/tests/CreationTest.cpp b/tests/CreationTest.cpp index 508c6a1d..d8fa4dd7 100644 --- a/tests/CreationTest.cpp +++ b/tests/CreationTest.cpp @@ -48,6 +48,20 @@ TEST_F(TApp, AddingExistingWithCaseAfter2) { EXPECT_THROW(cat->ignore_case(), CLI::OptionAlreadyAdded); } +TEST_F(TApp, AddingExistingWithUnderscoreAfter) { + auto count = app.add_flag("--underscore"); + app.add_flag("--under_score"); + + EXPECT_THROW(count->ignore_underscore(), CLI::OptionAlreadyAdded); +} + +TEST_F(TApp, AddingExistingWithUnderscoreAfter2) { + auto count = app.add_flag("--under_score"); + app.add_flag("--underscore"); + + EXPECT_THROW(count->ignore_underscore(), CLI::OptionAlreadyAdded); +} + TEST_F(TApp, AddingMultipleInfPositionals) { std::vector one, two; app.add_option("one", one);