eden/fs/inodes/test/DiffTest.cpp
/*
 * The following tests modify the directory contents using resetCommit()
 * This exercises a different code path than when using FUSE-like filesystem
 * APIs.  When using the normal filesystem APIs we end up with materialized
 * files.  When using resetCommit() we end up with files that are not
 * materialized, but are nonetheless different than the current commit.
 */
The following tests modify the directory contents using resetCommit()
This exercises a different code path than when using FUSE-like filesystem
APIs.  When using the normal filesystem APIs we end up with materialized
files.  When using resetCommit() we end up with files that are not
materialized, but are nonetheless different than the current commit.
The following tests modify the directory contents using resetCommit () This exercises a different code path than when using FUSE - like filesystem APIs . When using the normal filesystem APIs we end up with materialized files . When using resetCommit () we end up with files that are not materialized but are nonetheless different than the current commit .
void testResetFileModified(bool loadInodes) {
  SCOPED_TRACE(folly::to<string>("loadInodes=", loadInodes));
  DiffTest t;
  auto b2 = t.getBuilder().clone();
  b2.replaceFile("src/1.txt", "This file has been updated.\n");
  auto result = t.resetCommitAndDiff(b2, loadInodes);
  EXPECT_THAT(result.getErrors(), UnorderedElementsAre());
  EXPECT_THAT(result.getUntracked(), UnorderedElementsAre());
  EXPECT_THAT(result.getIgnored(), UnorderedElementsAre());
  EXPECT_THAT(result.getRemoved(), UnorderedElementsAre());
  EXPECT_THAT(
      result.getModified(), UnorderedElementsAre(RelativePath{"src/1.txt"}));
}
void testResetFileModified ( bool loadInodes ) { SCOPED_TRACE ( folly :: to < string > ( " " , loadInodes ) ) ; DiffTest t ; auto b2 = t . getBuilder ( ) . clone ( ) ; b2 . replaceFile ( " " , " \n " ) ; auto result = t . resetCommitAndDiff ( b2 , loadInodes ) ; EXPECT_THAT ( result . getErrors ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getUntracked ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getIgnored ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getRemoved ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getModified ( ) , UnorderedElementsAre ( RelativePath { " " } ) ) ; }
The following tests modify the directory contents using resetCommit()
 This exercises a different code path than when using FUSE-like filesystem
 APIs.
The following tests modify the directory contents using resetCommit () This exercises a different code path than when using FUSE - like filesystem APIs .