File: test_stringstream.cpp

package info (click to toggle)
libargparse 3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 896 kB
  • sloc: cpp: 11,319; python: 8; makefile: 4; sh: 3
file content (20 lines) | stat: -rw-r--r-- 484 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifdef WITH_MODULE
import argparse;
#else
#include <argparse/argparse.hpp>
#endif
#include <doctest.hpp>

#include <cmath>
#include <string>
#include <vector>

using doctest::test_suite;

TEST_CASE("Get Version String" * test_suite("stringstream")) {
  std::stringstream os;
  argparse::ArgumentParser program("test", "1.0",
                                   argparse::default_arguments::all, false, os);
  program.parse_args({"test", "--version"});
  REQUIRE(os.str() == "1.0\n");
}