Skip to content

Commit

Permalink
test(fsutil): update comments in create_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornplusplus committed Dec 5, 2024
1 parent 65e317f commit 887b095
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/fsutil/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,18 @@ func (s *S) TestCreate(c *C) {
c.Assert(err, IsNil)
c.Assert(testutil.TreeDump(dir), DeepEquals, test.result)

// [fsutil.Create] does not return information about parent directories
// created implicitly. We only check for the requested path.
if entry.HardLink {
// We should test hard link entries differently to ensure that it
// produces a hard link indeed.
// We should test hard link entries differently because
// fsutil.Create does not return hash or size when it creates hard
// links.
pathInfo, err := os.Lstat(entry.Path)
c.Assert(err, IsNil)
linkInfo, err := os.Lstat(entry.Link)
c.Assert(err, IsNil)
os.SameFile(pathInfo, linkInfo)
} else {
// [fsutil.Create] does not return information about parent directories
// created implicitly. We only check for the requested path.
entry.Path = strings.TrimPrefix(entry.Path, dir)
// Add the slashes that TreeDump adds to the path.
slashPath := "/" + test.options.Path
Expand Down

0 comments on commit 887b095

Please sign in to comment.