mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-29 20:23:55 +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));
|
output.push_back(str.substr(1,end-1));
|
||||||
str = str.substr(end+1);
|
str = str.substr(end+1);
|
||||||
} else {
|
} else {
|
||||||
output.push_back(str);
|
output.push_back(str.substr(1));
|
||||||
str = "";
|
str = "";
|
||||||
}
|
}
|
||||||
} else if(str[0] == '\"') {
|
} 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));
|
output.push_back(str.substr(1,end-1));
|
||||||
str = str.substr(end+1);
|
str = str.substr(end+1);
|
||||||
} else {
|
} else {
|
||||||
output.push_back(str);
|
output.push_back(str.substr(1));
|
||||||
str = "";
|
str = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,12 +298,12 @@ TEST(SplitUp, Spaces) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(SplitUp, BadStrings) {
|
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::string orig {" one \" two three "};
|
||||||
std::vector<std::string> result = CLI::detail::split_up(orig);
|
std::vector<std::string> result = CLI::detail::split_up(orig);
|
||||||
EXPECT_EQ(oput, result);
|
EXPECT_EQ(oput, result);
|
||||||
|
|
||||||
oput = {"one", "\' two three"};
|
oput = {"one", " two three"};
|
||||||
orig = " one \' two three ";
|
orig = " one \' two three ";
|
||||||
result = CLI::detail::split_up(orig);
|
result = CLI::detail::split_up(orig);
|
||||||
EXPECT_EQ(oput, result);
|
EXPECT_EQ(oput, result);
|
||||||
|
@ -331,8 +331,3 @@ TEST_F(TApp, IniOutputFlag) {
|
|||||||
EXPECT_THAT(str, Not(HasSubstr("nothing=")));
|
EXPECT_THAT(str, Not(HasSubstr("nothing=")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TApp, IniSpaces) {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user