@@ -2239,6 +2239,38 @@ TEST_F(VFSFromYAMLTest, YAMLVFSWriterTest) {
2239
2239
EXPECT_TRUE (FS->exists (_h.Path ));
2240
2240
}
2241
2241
2242
+ TEST_F (VFSFromYAMLTest, YAMLVFSWriterTest2) {
2243
+ ScopedDir TestDirectory (" virtual-file-system-test" , /* Unique*/ true );
2244
+ ScopedDir _a (TestDirectory + " /a" );
2245
+ ScopedFile _ab (TestDirectory + " /a/b" , " " );
2246
+ ScopedDir _ac (TestDirectory + " /a/c" );
2247
+ ScopedFile _acd (TestDirectory + " /a/c/d" , " " );
2248
+ ScopedFile _ace (TestDirectory + " /a/c/e" , " " );
2249
+ ScopedFile _acf (TestDirectory + " /a/c/f" , " " );
2250
+ ScopedDir _ag (TestDirectory + " /a/g" );
2251
+ ScopedFile _agh (TestDirectory + " /a/g/h" , " " );
2252
+
2253
+ vfs::YAMLVFSWriter VFSWriter;
2254
+ VFSWriter.addDirectoryMapping (_a.Path , " //root/a" );
2255
+ VFSWriter.addFileMapping (_ab.Path , " //root/a/b" );
2256
+ VFSWriter.addDirectoryMapping (_ac.Path , " //root/a/c" );
2257
+ VFSWriter.addFileMapping (_acd.Path , " //root/a/c/d" );
2258
+ VFSWriter.addFileMapping (_ace.Path , " //root/a/c/e" );
2259
+ VFSWriter.addFileMapping (_acf.Path , " //root/a/c/f" );
2260
+ VFSWriter.addDirectoryMapping (_ag.Path , " //root/a/g" );
2261
+ VFSWriter.addFileMapping (_agh.Path , " //root/a/g/h" );
2262
+
2263
+ std::string Buffer;
2264
+ raw_string_ostream OS (Buffer);
2265
+ VFSWriter.write (OS);
2266
+ OS.flush ();
2267
+
2268
+ IntrusiveRefCntPtr<ErrorDummyFileSystem> Lower (new ErrorDummyFileSystem ());
2269
+ IntrusiveRefCntPtr<vfs::FileSystem> FS = getFromYAMLRawString (Buffer, Lower);
2270
+ // FIXME: Missing comma separator between file entries.
2271
+ EXPECT_FALSE (FS.get () != nullptr );
2272
+ }
2273
+
2242
2274
TEST_F (VFSFromYAMLTest, YAMLVFSWriterTestHandleDirs) {
2243
2275
ScopedDir TestDirectory (" virtual-file-system-test" , /* Unique*/ true );
2244
2276
ScopedDir _a (TestDirectory + " /a" );
0 commit comments