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

Unified Diff: net/ftp/ftp_util_unittest.cc

Issue 2610973002: Fix a pair of bugs in UNIX->VMS path conversion. (Closed)
Patch Set: Created 3 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 | « net/ftp/ftp_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_util_unittest.cc
diff --git a/net/ftp/ftp_util_unittest.cc b/net/ftp/ftp_util_unittest.cc
index 400d3cf723c2016bb95fd69f2ea8b8747b35c1ba..8342fb4e5344360b94b5557c8131673e85323bce 100644
--- a/net/ftp/ftp_util_unittest.cc
+++ b/net/ftp/ftp_util_unittest.cc
@@ -34,6 +34,11 @@ TEST(FtpUtilTest, UnixFilePathToVMS) {
{ "a/b", "[.a]b" },
{ "a/b/c", "[.a.b]c" },
{ "a/b/c/d", "[.a.b.c]d" },
+ // Extra slashes shouldn't matter.
+ { "/////", "[]" },
+ { "/////a", "a" },
+ { "//a//b///c", "a:[b]c" },
+ { "a//b///c", "[.a.b]c" },
};
for (size_t i = 0; i < arraysize(kTestCases); i++) {
EXPECT_EQ(kTestCases[i].expected_output,
@@ -47,26 +52,30 @@ TEST(FtpUtilTest, UnixDirectoryPathToVMS) {
const char* input;
const char* expected_output;
} kTestCases[] = {
- { "", "" },
- { "/", "" },
- { "/a", "a:[000000]" },
- { "/a/", "a:[000000]" },
- { "/a/b", "a:[b]" },
- { "/a/b/", "a:[b]" },
- { "/a/b/c", "a:[b.c]" },
- { "/a/b/c/", "a:[b.c]" },
- { "/a/b/c/d", "a:[b.c.d]" },
- { "/a/b/c/d/", "a:[b.c.d]" },
- { "/a/b/c/d/e", "a:[b.c.d.e]" },
- { "/a/b/c/d/e/", "a:[b.c.d.e]" },
- { "a", "[.a]" },
- { "a/", "[.a]" },
- { "a/b", "[.a.b]" },
- { "a/b/", "[.a.b]" },
- { "a/b/c", "[.a.b.c]" },
- { "a/b/c/", "[.a.b.c]" },
- { "a/b/c/d", "[.a.b.c.d]" },
- { "a/b/c/d/", "[.a.b.c.d]" },
+ { "", "" },
+ { "/", "" },
+ { "/a", "a:[000000]" },
+ { "/a/", "a:[000000]" },
+ { "/a/b", "a:[b]" },
+ { "/a/b/", "a:[b]" },
+ { "/a/b/c", "a:[b.c]" },
+ { "/a/b/c/", "a:[b.c]" },
+ { "/a/b/c/d", "a:[b.c.d]" },
+ { "/a/b/c/d/", "a:[b.c.d]" },
+ { "/a/b/c/d/e", "a:[b.c.d.e]" },
+ { "/a/b/c/d/e/", "a:[b.c.d.e]" },
+ { "a", "[.a]" },
+ { "a/", "[.a]" },
+ { "a/b", "[.a.b]" },
+ { "a/b/", "[.a.b]" },
+ { "a/b/c", "[.a.b.c]" },
+ { "a/b/c/", "[.a.b.c]" },
+ { "a/b/c/d", "[.a.b.c.d]" },
+ { "a/b/c/d/", "[.a.b.c.d]" },
+ // Extra slashes shouldn't matter.
+ { "/////", "" },
+ { "//a//b///c//", "a:[b.c]" },
+ { "a//b///c//", "[.a.b.c]" },
};
for (size_t i = 0; i < arraysize(kTestCases); i++) {
EXPECT_EQ(kTestCases[i].expected_output,
« no previous file with comments | « net/ftp/ftp_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698