[PATCH] D79550: [YAMLVFSWriter][Tests] Fix YAMLVFSWriterTest

Jan Korous via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 22:08:50 PDT 2020


jkorous created this revision.
jkorous added a reviewer: JDevlieghere.
Herald added subscribers: llvm-commits, dexonsmith.
Herald added a project: LLVM.

I assume we want to keep type of item (file vs dir) consistent between:

- `Scoped*`
- `VFSWriter.add*`
- `Lower->add*`

I based the fix on what type was used for mapping but not sure if that's exactly the case we want to have covered - happy to change it.


https://reviews.llvm.org/D79550

Files:
  llvm/unittests/Support/VirtualFileSystemTest.cpp


Index: llvm/unittests/Support/VirtualFileSystemTest.cpp
===================================================================
--- llvm/unittests/Support/VirtualFileSystemTest.cpp
+++ llvm/unittests/Support/VirtualFileSystemTest.cpp
@@ -2197,8 +2197,8 @@
   ScopedFile _cd(TestDirectory + "/c/d", "");
   ScopedDir _e(TestDirectory + "/e");
   ScopedDir _ef(TestDirectory + "/e/f");
-  ScopedDir _g(TestDirectory + "/g");
-  ScopedFile _h(TestDirectory + "/h", "");
+  ScopedFile _g(TestDirectory + "/g", "");
+  ScopedDir _h(TestDirectory + "/h");
 
   vfs::YAMLVFSWriter VFSWriter;
   VFSWriter.addDirectoryMapping(_a.Path, "//root/a");
@@ -2223,8 +2223,8 @@
   Lower->addRegularFile("//root/c/d");
   Lower->addDirectory("//root/e");
   Lower->addDirectory("//root/e/f");
-  Lower->addDirectory("//root/g");
-  Lower->addRegularFile("//root/h");
+  Lower->addRegularFile("//root/g");
+  Lower->addDirectory("//root/h");
 
   IntrusiveRefCntPtr<vfs::FileSystem> FS = getFromYAMLRawString(Buffer, Lower);
   ASSERT_TRUE(FS.get() != nullptr);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79550.262543.patch
Type: text/x-patch
Size: 1040 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200507/0750700f/attachment.bin>


More information about the llvm-commits mailing list