Skip to content

Commit

Permalink
test: OverrideMode does not affect symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
letFunny committed Oct 24, 2024
1 parent b7e10ce commit 7d34dc0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions internal/fsutil/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,24 @@ var createTests = []createTest{{
result: map[string]string{
"/foo": "symlink ./bar",
},
}, {
options: fsutil.CreateOptions{
Path: "foo",
Link: "./bar",
Mode: 0776 | fs.ModeSymlink,
OverrideMode: true,
},
hackdir: func(c *C, dir string) {
err := os.WriteFile(filepath.Join(dir, "bar"), []byte("data"), 0666)
c.Assert(err, IsNil)
err = os.WriteFile(filepath.Join(dir, "foo"), []byte("data"), 0666)
c.Assert(err, IsNil)
},
result: map[string]string{
"/foo": "symlink ./bar",
// mode is not updated.
"/bar": "file 0666 3a6eb079",
},
}, {
options: fsutil.CreateOptions{
Path: "bar",
Expand Down

0 comments on commit 7d34dc0

Please sign in to comment.