mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
This change also explicitly lists the source files for CMake. This is because `GLOB` does not remove old files when switching branches in Git, and `CONFIGURE_DEPENDS` will add unstaged files after stashing. See also: https://cmake.org/cmake/help/latest/command/file.html#glob
20 lines
447 B
C++
20 lines
447 B
C++
#include <doctest.hpp>
|
|
#include <argparse.hpp>
|
|
|
|
using doctest::test_suite;
|
|
|
|
TEST_CASE("Users can format help message" * test_suite("help")) {
|
|
argparse::ArgumentParser program("test");
|
|
program.add_argument("input")
|
|
.help("positional input");
|
|
program.add_argument("-c")
|
|
.help("optional input");
|
|
|
|
std::ostringstream s;
|
|
s << program;
|
|
REQUIRE_FALSE(s.str().empty());
|
|
|
|
auto msg = program.help().str();
|
|
REQUIRE(msg == s.str());
|
|
}
|