mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-03 22:54:39 +00:00
18 lines
413 B
C++
18 lines
413 B
C++
#include <doctest.hpp>
|
|
#include <argparse.hpp>
|
|
|
|
DOCTEST_TEST_CASE("Users can format help message [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());
|
|
}
|