summaryrefslogtreecommitdiffstats
path: root/src/util_test.cc
diff options
context:
space:
mode:
authorScott Graham <scottmg@chromium.org>2014-11-08 19:25:03 (GMT)
committerScott Graham <scottmg@chromium.org>2014-11-08 19:25:03 (GMT)
commit3fb18496c4c2642742df152974d78756d1c9df8a (patch)
tree6cbce5b10eea5543e43d967b67b4ca79e190ff8c /src/util_test.cc
parentaacfd606f463bc3a7c2cc92d961dbded7979051c (diff)
downloadNinja-3fb18496c4c2642742df152974d78756d1c9df8a.zip
Ninja-3fb18496c4c2642742df152974d78756d1c9df8a.tar.gz
Ninja-3fb18496c4c2642742df152974d78756d1c9df8a.tar.bz2
fix multiple sequential slashes
Diffstat (limited to 'src/util_test.cc')
-rw-r--r--src/util_test.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util_test.cc b/src/util_test.cc
index 36f212e..d047d9c 100644
--- a/src/util_test.cc
+++ b/src/util_test.cc
@@ -218,6 +218,21 @@ TEST(CanonicalizePath, SlashTracking) {
EXPECT_TRUE(CanonicalizePath(&path, &err, &slash_bits));
EXPECT_EQ("a/g/foo.h", path);
EXPECT_EQ(1, slash_bits);
+
+ path = "a\\\\\\foo.h";
+ EXPECT_TRUE(CanonicalizePath(&path, &err, &slash_bits));
+ EXPECT_EQ("a/foo.h", path);
+ EXPECT_EQ(1, slash_bits);
+
+ path = "a/\\\\foo.h";
+ EXPECT_TRUE(CanonicalizePath(&path, &err, &slash_bits));
+ EXPECT_EQ("a/foo.h", path);
+ EXPECT_EQ(0, slash_bits);
+
+ path = "a\\//foo.h";
+ EXPECT_TRUE(CanonicalizePath(&path, &err, &slash_bits));
+ EXPECT_EQ("a/foo.h", path);
+ EXPECT_EQ(1, slash_bits);
}
#endif