diff options
Diffstat (limited to 'absl/flags/parse_test.cc')
-rw-r--r-- | absl/flags/parse_test.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/absl/flags/parse_test.cc b/absl/flags/parse_test.cc index 13606d14..f3987bb7 100644 --- a/absl/flags/parse_test.cc +++ b/absl/flags/parse_test.cc @@ -17,10 +17,8 @@ #include <stdlib.h> -#include <cstddef> #include <fstream> #include <string> -#include <utility> #include <vector> #include "gmock/gmock.h" @@ -1061,4 +1059,17 @@ TEST_F(ParseTest, AllUndefOkFlagsAreIgnored) { // -------------------------------------------------------------------- +TEST_F(ParseDeathTest, ExitOnUnrecognizedFlagPrintsHelp) { + const char* in_args[] = { + "testbin", + "--undef_flag1", + "--help=int_flag", + }; + + EXPECT_DEATH_IF_SUPPORTED(InvokeParse(in_args), + "Try --helpfull to get a list of all flags"); +} + +// -------------------------------------------------------------------- + } // namespace |