continue;
}
- // FIXME: Remove once clients are updated to use a KIND_REMAINING_ARGS
- // option to handle this explicitly instead.
- if (Str == "--") {
- // Everything after -- is a filename.
- ++Index;
-
- assert(TheInputOptionID != 0 && "Invalid input option ID.");
- while (Index < End) {
- Args->append(new Arg(getOption(TheInputOptionID),
- Args->getArgString(Index), Index,
- Args->getArgString(Index)));
- ++Index;
- }
- break;
- }
-
unsigned Prev = Index;
Arg *A = ParseOneArg(*Args, Index, FlagsToInclude, FlagsToExclude);
assert(Index > Prev && "Parser failed to consume argument.");
EXPECT_EQ(AL->getAllArgValues(OPT_B)[1], "bar");
}
-TEST(Option, DashDash) {
- TestOptTable T;
- unsigned MAI, MAC;
-
- const char *MyArgs[] = { "-A", "--", "-B", "--" };
- OwningPtr<InputArgList> AL(T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
- EXPECT_TRUE(AL->hasArg(OPT_A));
- EXPECT_FALSE(AL->hasArg(OPT_B));
- EXPECT_EQ(AL->getAllArgValues(OPT_INPUT).size(), 2U);
- EXPECT_EQ(AL->getAllArgValues(OPT_INPUT)[0], "-B");
- EXPECT_EQ(AL->getAllArgValues(OPT_INPUT)[1], "--");
-}
-
TEST(Option, SlurpEmpty) {
TestOptTable T;
unsigned MAI, MAC;
OwningPtr<InputArgList> AL(T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
EXPECT_TRUE(AL->hasArg(OPT_A));
EXPECT_TRUE(AL->hasArg(OPT_Slurp));
- EXPECT_EQ(AL->getAllArgValues(OPT_Slurp).size(), 0);
+ EXPECT_EQ(AL->getAllArgValues(OPT_Slurp).size(), 0U);
}
TEST(Option, Slurp) {