summaryrefslogtreecommitdiff
path: root/unittests/Option
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Option')
-rw-r--r--unittests/Option/OptionParsingTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/unittests/Option/OptionParsingTest.cpp b/unittests/Option/OptionParsingTest.cpp
index 2a5a5a9c94..5a76d65d0f 100644
--- a/unittests/Option/OptionParsingTest.cpp
+++ b/unittests/Option/OptionParsingTest.cpp
@@ -156,3 +156,16 @@ TEST(Option, AliasArgs) {
EXPECT_EQ(AL->getAllArgValues(OPT_B)[0], "foo");
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], "--");
+}