diff options
Diffstat (limited to 'src/mongo/util/text_test.cpp')
-rw-r--r-- | src/mongo/util/text_test.cpp | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/src/mongo/util/text_test.cpp b/src/mongo/util/text_test.cpp index 110938744d3..d2d883eab5a 100644 --- a/src/mongo/util/text_test.cpp +++ b/src/mongo/util/text_test.cpp @@ -55,39 +55,37 @@ TEST(WindowsCommandLineConstruction, EmptyCommandLine) { } TEST(WindowsCommandLineConstruction, NothingToQuote) { - ASSERT_EQUALS("abc d \"\" e", - constructUtf8WindowsCommandLine(svec("abc", "d", "", "e", NULL))); + ASSERT_EQUALS("abc d \"\" e", constructUtf8WindowsCommandLine(svec("abc", "d", "", "e", NULL))); } TEST(WindowsCommandLineConstruction, ThingsToQuote) { ASSERT_EQUALS("a\\\\\\b \"de fg\" h", constructUtf8WindowsCommandLine(svec("a\\\\\\b", "de fg", "h", NULL))); ASSERT_EQUALS("\"a\\\\b c\" d e", - constructUtf8WindowsCommandLine(svec("a\\\\b c", "d" , "e", NULL))); - ASSERT_EQUALS("\"a \\\\\" \\", - constructUtf8WindowsCommandLine(svec("a \\", "\\", NULL))); - ASSERT_EQUALS("\"\\\\\\\\\\\"\"", - constructUtf8WindowsCommandLine(svec("\\\\\"", NULL))); + constructUtf8WindowsCommandLine(svec("a\\\\b c", "d", "e", NULL))); + ASSERT_EQUALS("\"a \\\\\" \\", constructUtf8WindowsCommandLine(svec("a \\", "\\", NULL))); + ASSERT_EQUALS("\"\\\\\\\\\\\"\"", constructUtf8WindowsCommandLine(svec("\\\\\"", NULL))); } TEST(WindowsCommandLineConstruction, RegressionSERVER_7252) { - ASSERT_EQUALS("mongod \"--serviceName=My Service\" --serviceDescription \"My Service\" " - "--serviceDisplayName \"My Service\" --dbpath C:\\mongo\\data\\config " - "--port 20001 --logpath C:\\mongo\\logs\\mongo_config.log.txt " - "--configsvr --service", - constructUtf8WindowsCommandLine(svec("mongod", - "--serviceName=My Service", - "--serviceDescription", - "My Service", - "--serviceDisplayName", - "My Service", - "--dbpath", - "C:\\mongo\\data\\config", - "--port", "20001", - "--logpath", - "C:\\mongo\\logs\\mongo_config.log.txt", - "--configsvr", - "--service", - NULL))); - + ASSERT_EQUALS( + "mongod \"--serviceName=My Service\" --serviceDescription \"My Service\" " + "--serviceDisplayName \"My Service\" --dbpath C:\\mongo\\data\\config " + "--port 20001 --logpath C:\\mongo\\logs\\mongo_config.log.txt " + "--configsvr --service", + constructUtf8WindowsCommandLine(svec("mongod", + "--serviceName=My Service", + "--serviceDescription", + "My Service", + "--serviceDisplayName", + "My Service", + "--dbpath", + "C:\\mongo\\data\\config", + "--port", + "20001", + "--logpath", + "C:\\mongo\\logs\\mongo_config.log.txt", + "--configsvr", + "--service", + NULL))); } |