1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-02 13:43:52 +00:00

tests: fix minor errors to prepare for Catch2

This commit is contained in:
Henry Schreiner 2021-04-03 00:17:30 -04:00 committed by Henry Schreiner
parent 34c4310d99
commit b00b56061a
2 changed files with 7 additions and 6 deletions

View File

@ -167,7 +167,10 @@ TEST_F(TApp, MultipleSubcomNoMatchingInplaceUnderscore2) {
EXPECT_NO_THROW(second->ignore_underscore()); EXPECT_NO_THROW(second->ignore_underscore());
} }
TEST_F(TApp, IncorrectConstructionFlagPositional1) { EXPECT_THROW(app.add_flag("cat"), CLI::IncorrectConstruction); } TEST_F(TApp, IncorrectConstructionFlagPositional1) {
// This wants to be one line with clang-format
EXPECT_THROW(app.add_flag("cat"), CLI::IncorrectConstruction);
}
TEST_F(TApp, IncorrectConstructionFlagPositional2) { TEST_F(TApp, IncorrectConstructionFlagPositional2) {
int x{0}; int x{0};

View File

@ -12,7 +12,7 @@
#include "CLI/CLI.hpp" #include "CLI/CLI.hpp"
#endif #endif
#include "gtest/gtest.h" #include "catch.hpp"
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <utility> #include <utility>
@ -20,11 +20,11 @@
using input_t = std::vector<std::string>; using input_t = std::vector<std::string>;
class TApp_base { class TApp {
public: public:
CLI::App app{"My Test Program"}; CLI::App app{"My Test Program"};
input_t args{}; input_t args{};
virtual ~TApp_base() = default; virtual ~TApp() = default;
void run() { void run() {
// It is okay to re-parse - clear is called automatically before a parse. // It is okay to re-parse - clear is called automatically before a parse.
input_t newargs = args; input_t newargs = args;
@ -33,8 +33,6 @@ class TApp_base {
} }
}; };
class TApp : public TApp_base, public ::testing::Test {};
class TempFile { class TempFile {
std::string _name{}; std::string _name{};