Index: base/command_line_unittest.cc |
=================================================================== |
--- base/command_line_unittest.cc (revision 66046) |
+++ base/command_line_unittest.cc (working copy) |
@@ -5,8 +5,8 @@ |
#include <string> |
#include <vector> |
+#include "base/basictypes.h" |
#include "base/command_line.h" |
-#include "base/basictypes.h" |
#include "base/file_path.h" |
#include "base/utf_string_conversions.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -154,3 +154,17 @@ |
cl.command_line_string()); |
#endif |
} |
+ |
+// Tests that when AppendArguments is called that both the program and |
+// command line strings are equal. |
+TEST(CommandLineTest, AppendArguments) { |
+ CommandLine cl1(FilePath(FILE_PATH_LITERAL("Program"))); |
+ cl1.AppendSwitch("switch1"); |
+ cl1.AppendSwitchASCII("switch2", "foo"); |
+ |
+ CommandLine cl2(CommandLine::NO_PROGRAM); |
+ cl2.AppendArguments(cl1, true); |
+ EXPECT_EQ(cl1.GetProgram().value(), cl2.GetProgram().value()); |
+ EXPECT_EQ(cl1.command_line_string(), cl2.command_line_string()); |
robertshield
2010/11/14 15:21:31
Could you also test the new replacement behaviour
tommi (sloooow) - chröme
2010/11/14 21:28:07
Done.
|
+} |
+ |