summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2014-06-27 22:51:56 (GMT)
committerNico Weber <thakis@chromium.org>2014-06-27 22:51:56 (GMT)
commit95c03b40bfe4ea5c8383bba25b4a2f42068e4e9d (patch)
treee0d1d5a1dea234b94b13401ef853bde4c5f006e4
parent6fa4beb8b991f7f22966df6c90ff776cac60c833 (diff)
downloadNinja-95c03b40bfe4ea5c8383bba25b4a2f42068e4e9d.zip
Ninja-95c03b40bfe4ea5c8383bba25b4a2f42068e4e9d.tar.gz
Ninja-95c03b40bfe4ea5c8383bba25b4a2f42068e4e9d.tar.bz2
add a test for stat()ing a directory
-rw-r--r--src/disk_interface_test.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/disk_interface_test.cc b/src/disk_interface_test.cc
index f4e0bb0..18e48a2 100644
--- a/src/disk_interface_test.cc
+++ b/src/disk_interface_test.cc
@@ -76,6 +76,11 @@ TEST_F(DiskInterfaceTest, StatExistingFile) {
EXPECT_GT(disk_.Stat("file"), 1);
}
+TEST_F(DiskInterfaceTest, StatExistingDir) {
+ ASSERT_TRUE(disk_.MakeDir("subdir"));
+ EXPECT_GT(disk_.Stat("subdir"), 1);
+}
+
#ifdef _WIN32
TEST_F(DiskInterfaceTest, StatCache) {
disk_.AllowStatCache(true);
@@ -90,6 +95,7 @@ TEST_F(DiskInterfaceTest, StatCache) {
EXPECT_GT(disk_.Stat("FIle1"), 1);
EXPECT_GT(disk_.Stat("file1"), 1);
+ EXPECT_GT(disk_.Stat("subdir"), 1);
EXPECT_GT(disk_.Stat("subdir/subfile2"), 1);
EXPECT_GT(disk_.Stat("sUbdir\\suBFile1"), 1);