| 202 | } |
| 203 | |
| 204 | TEST_F(TestHadoopFileSystem, CreateDirDeleteDir) { |
| 205 | SKIP_IF_NO_DRIVER(); |
| 206 | |
| 207 | // recursive = true |
| 208 | ASSERT_OK(this->fs_->CreateDir("AB/CD")); |
| 209 | CreateFile(this->fs_.get(), "AB/CD/data", "some data"); |
| 210 | AssertFileInfo(this->fs_.get(), "AB", FileType::Directory); |
| 211 | AssertFileInfo(this->fs_.get(), "AB/CD", FileType::Directory); |
| 212 | AssertFileInfo(this->fs_.get(), "AB/CD/data", FileType::File, 9); |
| 213 | |
| 214 | ASSERT_OK(this->fs_->DeleteDir("AB")); |
| 215 | AssertFileInfo(this->fs_.get(), "AB", FileType::NotFound); |
| 216 | |
| 217 | // recursive = false |
| 218 | ASSERT_RAISES(IOError, this->fs_->CreateDir("AB/CD", /*recursive=*/false)); |
| 219 | ASSERT_OK(this->fs_->CreateDir("AB", /*recursive=*/false)); |
| 220 | ASSERT_OK(this->fs_->CreateDir("AB/CD", /*recursive=*/false)); |
| 221 | |
| 222 | ASSERT_OK(this->fs_->DeleteDir("AB")); |
| 223 | AssertFileInfo(this->fs_.get(), "AB", FileType::NotFound); |
| 224 | |
| 225 | auto st = this->fs_->DeleteDir("AB"); |
| 226 | ASSERT_RAISES(IOError, st); |
| 227 | ASSERT_EQ(ErrnoFromStatus(st), ENOENT); |
| 228 | } |
| 229 | |
| 230 | TEST_F(TestHadoopFileSystem, DeleteDirContents) { |
| 231 | SKIP_IF_NO_DRIVER(); |
nothing calls this directly
no test coverage detected