" command = cat $in > $out\n"
"build ./out.o: cat ./bar/baz/../foo.cc\n"
"build .\\out2.o: cat .\\bar/baz\\..\\foo.cc\n"
-"build .\\out3.o: cat .\\bar/baz\\..\\foo3.cc\n"
+"build .\\out3.o: cat .\\bar\\baz\\..\\foo3.cc\n"
));
EXPECT_FALSE(state.LookupNode("./out.o"));
EXPECT_EQ(0, node->slash_bits());
node = state.LookupNode("bar/foo3.cc");
EXPECT_TRUE(node);
- EXPECT_EQ(1, node->slash_bits()); // First seen determines slashes.
+ EXPECT_EQ(1, node->slash_bits());
}
#endif
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