Skip to content

Commit

Permalink
add a few more coverage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phlptp committed Oct 27, 2022
1 parent 90e6ee1 commit c3d68da
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Steps:
- Update changelog if needed
- Update the version in `.appveyor.yml` and `include/CLI/Version.hpp`.
- Find and replace in README (new minor/major release only):
- Replace " 🆕" and "🆕 " with "" (ignores the description line)
- Check for `\/\/$` (vi syntax) to catch leftover `// 🆕`
- Replace "🚧" with "🆕" (manually ignore the description line)
- Replace " 🆕" and "🆕 " with "" (ignores the description line)
- Check for `\/\/$` (vi syntax) to catch leftover `// 🆕`
- Replace "🚧" with "🆕" (manually ignore the description line)
- Make a release in the GitHub UI, use a name such as "Version X.Y(.Z): Title"
16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ a lot of backend cleanup, including a complete overhaul of the testing system
and single file generation system.

- Built-in config format is TOML compliant now [#435][]
- Support multiline TOML [#528][]
- Support for configurable quotes [#599][]
- Support short/positional options in config mode [#443][]
- Support multiline TOML [#528][]
- Support for configurable quotes [#599][]
- Support short/positional options in config mode [#443][]
- More powerful containers, support for `%%` separator [#423][]
- Support atomic types [#520][] and complex types natively [#423][]
- Add a type validator `CLI::TypeValidator<TYPE>` [#526][]
Expand Down Expand Up @@ -622,12 +622,12 @@ several warnings, including an experimental optional error on Clang 7. Several
smaller fixes.

- Fixed help-all formatting [#163][]
- Printing help-all on nested command now fixed (App)
- Missing space after help-all restored (Default formatter)
- More detail printed on help all (Default formatter)
- Help-all subcommands get indented with inner blank lines removed (Default
- Printing help-all on nested command now fixed (App)
- Missing space after help-all restored (Default formatter)
- More detail printed on help all (Default formatter)
- Help-all subcommands get indented with inner blank lines removed (Default
formatter)
- `detail::find_and_replace` added to utilities
- `detail::find_and_replace` added to utilities
- Fixed CMake install as subproject with `CLI11_INSTALL` flag. [#156][]
- Fixed warning about local variable hiding class member with MSVC [#157][]
- Fixed compile error with default settings on Clang 7 and libc++ [#158][]
Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,33 @@ set with a simple and intuitive interface.
## Table of Contents

- [Background](#background)
- [Introduction](#introduction)
- [Why write another CLI parser?](#why-write-another-cli-parser)
- [Other parsers](#other-parsers)
- [Features not supported by this library](#features-not-supported-by-this-library)
- [Introduction](#introduction)
- [Why write another CLI parser?](#why-write-another-cli-parser)
- [Other parsers](#other-parsers)
- [Features not supported by this library](#features-not-supported-by-this-library)
- [Install](#install)
- [Usage](#usage)
- [Adding options](#adding-options)
- [Option types](#option-types)
- [Example](#example)
- [Option options](#option-options)
- [Validators](#validators)
- [Transforming Validators](#transforming-validators)
- [Validator operations](#validator-operations)
- [Custom Validators](#custom-validators)
- [Querying Validators](#querying-validators)
- [Getting Results](#getting-results)
- [Subcommands](#subcommands)
- [Subcommand options](#subcommand-options)
- [Option groups](#option-groups)
- [Callbacks](#callbacks)
- [Configuration file](#configuration-file)
- [Inheriting defaults](#inheriting-defaults)
- [Formatting](#formatting)
- [Subclassing](#subclassing)
- [How it works](#how-it-works)
- [Utilities](#utilities)
- [Other libraries](#other-libraries)
- [Adding options](#adding-options)
- [Option types](#option-types)
- [Example](#example)
- [Option options](#option-options)
- [Validators](#validators)
- [Transforming Validators](#transforming-validators)
- [Validator operations](#validator-operations)
- [Custom Validators](#custom-validators)
- [Querying Validators](#querying-validators)
- [Getting Results](#getting-results)
- [Subcommands](#subcommands)
- [Subcommand options](#subcommand-options)
- [Option groups](#option-groups)
- [Callbacks](#callbacks)
- [Configuration file](#configuration-file)
- [Inheriting defaults](#inheriting-defaults)
- [Formatting](#formatting)
- [Subclassing](#subclassing)
- [How it works](#how-it-works)
- [Utilities](#utilities)
- [Other libraries](#other-libraries)
- [API](#api)
- [Examples](#Examples)
- [Contribute](#contribute)
Expand Down
2 changes: 1 addition & 1 deletion include/CLI/ConfigFwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Config {
if(item.inputs.empty()) {
return "{}";
}
throw ConversionError::TooManyInputsFlag(item.fullname());
throw ConversionError::TooManyInputsFlag(item.fullname()); //LCOV_EXCL_LINE
}

/// Parse a config file, throw an error (ParseError:ConfigParseError or FileError) on failure
Expand Down
4 changes: 4 additions & 0 deletions tests/HelpersTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,10 @@ TEST_CASE("Types: LexicalCastInt", "[helpers]") {
std::string extra_input = "912i";
CHECK_FALSE(CLI::detail::lexical_cast(extra_input, y));

extra_input = "true";
CHECK(CLI::detail::lexical_cast(extra_input, y));
CHECK(static_cast<bool>(y));

std::string empty_input{};
CHECK_FALSE(CLI::detail::lexical_cast(empty_input, x_signed));
CHECK_FALSE(CLI::detail::lexical_cast(empty_input, x_unsigned));
Expand Down

0 comments on commit c3d68da

Please sign in to comment.