mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-02 05:33:53 +00:00
tests: fix minor errors to prepare for Catch2
This commit is contained in:
parent
34c4310d99
commit
b00b56061a
@ -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};
|
||||||
|
@ -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{};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user