-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests that break expectation for Options.FS
#162
base: main
Are you sure you want to change the base?
Conversation
This commit adds tests to reproduce otiai10#153.
_, err = os.Stat(filepath.Join(subdir, dest)) | ||
Expect(t, err).ToBe(nil) | ||
}) | ||
When(t, "fs copy relative when fs is root", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could roll the ball either way whether or not this is an error or a feature. Here Copy
is not respecting the working directory when using FS
, if it was the test would pass.
OTOH, when providing the FS
you might not want this behavior.
Expect(t, err).ToBe(nil) | ||
|
||
_, err = os.Stat(filepath.Join(subdir, dest)) | ||
Expect(t, err).ToBe(nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Note to myself @otiai10 : This line is failing as of now https://github.com/otiai10/copy/actions/runs/10471541423/job/29006044545?pr=162
err := Copy("test/data/case18/assets", dest, Options{ | ||
FS: os.DirFS("/"), | ||
}) | ||
Expect(t, err).ToBe(nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Note to myself @otiai10 : This line is failing as of now https://github.com/otiai10/copy/actions/runs/10471541423/job/29006044545?pr=162
Thanks a lot! Let me take time to check it out 🙇 |
This commit adds tests to reproduce #153.
I believe this is what is being referred to in #153. It would be nice to be able to use the provided FS for both read and write operations.
Understandably this is not the case since
io/fs
doesn't support write operations but it would be very nice if this was a supported use-case.At the very least, it may be good to update docs to reflect this limitation.