mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-29 12:13:52 +00:00
Better ini config behavour with one quote
This commit is contained in:
parent
7b01535303
commit
0ca8a43ebd
@ -167,7 +167,7 @@ std::vector<std::string> inline split_up(std::string str) {
|
||||
output.push_back(str.substr(1,end-1));
|
||||
str = str.substr(end+1);
|
||||
} else {
|
||||
output.push_back(str);
|
||||
output.push_back(str.substr(1));
|
||||
str = "";
|
||||
}
|
||||
} else if(str[0] == '\"') {
|
||||
@ -176,7 +176,7 @@ std::vector<std::string> inline split_up(std::string str) {
|
||||
output.push_back(str.substr(1,end-1));
|
||||
str = str.substr(end+1);
|
||||
} else {
|
||||
output.push_back(str);
|
||||
output.push_back(str.substr(1));
|
||||
str = "";
|
||||
}
|
||||
|
||||
|
@ -298,12 +298,12 @@ TEST(SplitUp, Spaces) {
|
||||
}
|
||||
|
||||
TEST(SplitUp, BadStrings) {
|
||||
std::vector<std::string> oput = {"one", "\" two three"};
|
||||
std::vector<std::string> oput = {"one", " two three"};
|
||||
std::string orig {" one \" two three "};
|
||||
std::vector<std::string> result = CLI::detail::split_up(orig);
|
||||
EXPECT_EQ(oput, result);
|
||||
|
||||
oput = {"one", "\' two three"};
|
||||
oput = {"one", " two three"};
|
||||
orig = " one \' two three ";
|
||||
result = CLI::detail::split_up(orig);
|
||||
EXPECT_EQ(oput, result);
|
||||
|
@ -331,8 +331,3 @@ TEST_F(TApp, IniOutputFlag) {
|
||||
EXPECT_THAT(str, Not(HasSubstr("nothing=")));
|
||||
|
||||
}
|
||||
|
||||
TEST_F(TApp, IniSpaces) {
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user