Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1017)

Unified Diff: base/command_line_unittest.cc

Issue 19740: Merge r2876 to the 1.0 release branch.... (Closed) Base URL: svn://chrome-svn/chrome/branches/release_154.next/src/
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/command_line.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/command_line_unittest.cc
===================================================================
--- base/command_line_unittest.cc (revision 8989)
+++ base/command_line_unittest.cc (working copy)
@@ -21,6 +21,7 @@
L"--other-switches=\"--dog=canine --cat=feline\" "
L"-spaetzle=Crepe -=loosevalue flan "
L"--input-translation=\"45\"--output-rotation "
+ L"-- -- --not-a-switch "
L"\"in the time of submarines...\"");
#elif defined(OS_POSIX)
const char* argv[] = {"program", "--foo=", "-bAr",
@@ -28,6 +29,7 @@
"--other-switches=--dog=canine --cat=feline",
"-spaetzle=Crepe", "-=loosevalue", "flan",
"--input-translation=45--output-rotation",
+ "--", "--", "--not-a-switch",
"in the time of submarines..."};
CommandLine cl(arraysize(argv), argv);
#endif
@@ -38,6 +40,8 @@
EXPECT_FALSE(cl.HasSwitch(L"dog"));
EXPECT_FALSE(cl.HasSwitch(L"cat"));
EXPECT_FALSE(cl.HasSwitch(L"output-rotation"));
+ EXPECT_FALSE(cl.HasSwitch(L"not-a-switch"));
+ EXPECT_FALSE(cl.HasSwitch(L"--"));
EXPECT_EQ(L"program", cl.program());
@@ -56,13 +60,17 @@
EXPECT_EQ(L"--dog=canine --cat=feline", cl.GetSwitchValue(L"other-switches"));
EXPECT_EQ(L"45--output-rotation", cl.GetSwitchValue(L"input-translation"));
- EXPECT_EQ(3U, cl.GetLooseValueCount());
+ EXPECT_EQ(5U, cl.GetLooseValueCount());
CommandLine::LooseValueIterator iter = cl.GetLooseValuesBegin();
EXPECT_EQ(L"flim", *iter);
++iter;
EXPECT_EQ(L"flan", *iter);
++iter;
+ EXPECT_EQ(L"--", *iter);
+ ++iter;
+ EXPECT_EQ(L"--not-a-switch", *iter);
+ ++iter;
EXPECT_EQ(L"in the time of submarines...", *iter);
++iter;
EXPECT_TRUE(iter == cl.GetLooseValuesEnd());
@@ -116,4 +124,3 @@
EXPECT_EQ(value4.substr(1, value4.length() - 2), cl.GetSwitchValue(switch4));
}
#endif
-
« no previous file with comments | « base/command_line.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698