[llvm] [llvm][Support][Windows] Fix slash in path for remove_directories (PR #121448)

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 09:10:50 PST 2025


================
@@ -1326,6 +1326,9 @@ TEST_F(FileSystemTest, Remove) {
 
   ASSERT_NO_ERROR(fs::remove_directories("D:/footest"));
 
+  ASSERT_NO_ERROR(fs::remove_directories(Twine(BaseDir) + "/foo/bar/baz"));
----------------
jsji wrote:

```
bash-3.2$ ./unittests/Support/SupportTests.exe --gtest_filter=FileSystemTest.Remove
Note: Google Test filter = FileSystemTest.Remove
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from FileSystemTest
[ RUN      ] FileSystemTest.Remove
Test Directory: C:\Users\jinsongj\AppData\Local\Temp\3\file-system-test-09f535
D:/iusers/jinsongj/xmain-web/llvm/llvm/unittests/Support/Path.cpp(1339): error: Value of: fs::exists(Twine(BaseDir) + "/foo/bar/baz")
  Actual: true
Expected: false

[  FAILED  ] FileSystemTest.Remove (54 ms)
[----------] 1 test from FileSystemTest (57 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (63 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] FileSystemTest.Remove

```

https://github.com/llvm/llvm-project/pull/121448


More information about the llvm-commits mailing list