|
18 | 18 |
|
19 | 19 | #include "path.h" |
20 | 20 | #include "fixture.h" |
| 21 | +#include "helpers.h" |
21 | 22 |
|
22 | 23 | #include <string> |
23 | 24 | #include <vector> |
@@ -159,13 +160,21 @@ class TestPath : public TestFixture { |
159 | 160 | } |
160 | 161 |
|
161 | 162 | void isDirectory() const { |
162 | | - ASSERT_EQUALS(false, Path::isDirectory("readme.txt")); |
163 | | - ASSERT_EQUALS(true, Path::isDirectory("lib")); |
| 163 | + ScopedFile file("testpath.txt", "", "testpath"); |
| 164 | + ScopedFile file2("testpath2.txt", ""); |
| 165 | + ASSERT_EQUALS(false, Path::isDirectory("testpath.txt")); |
| 166 | + ASSERT_EQUALS(true, Path::isDirectory("testpath")); |
| 167 | + ASSERT_EQUALS(false, Path::isDirectory("testpath/testpath.txt")); |
| 168 | + ASSERT_EQUALS(false, Path::isDirectory("testpath2.txt")); |
164 | 169 | } |
165 | 170 |
|
166 | 171 | void isFile() const { |
167 | | - ASSERT_EQUALS(false, Path::isFile("lib")); |
168 | | - ASSERT_EQUALS(true, Path::isFile("readme.txt")); |
| 172 | + ScopedFile file("testpath.txt", "", "testpath"); |
| 173 | + ScopedFile file2("testpath2.txt", ""); |
| 174 | + ASSERT_EQUALS(false, Path::isFile("testpath")); |
| 175 | + ASSERT_EQUALS(false, Path::isFile("testpath.txt")); |
| 176 | + ASSERT_EQUALS(true, Path::isFile("testpath/testpath.txt")); |
| 177 | + ASSERT_EQUALS(true, Path::isFile("testpath2.txt")); |
169 | 178 | } |
170 | 179 | }; |
171 | 180 |
|
|
0 commit comments