Add tests that break expectation for Options.FS#162
Open
mafredri wants to merge 1 commit intootiai10:mainfrom
Open
Add tests that break expectation for Options.FS#162mafredri wants to merge 1 commit intootiai10:mainfrom
Options.FS#162mafredri wants to merge 1 commit intootiai10:mainfrom
Conversation
This commit adds tests to reproduce otiai10#153.
mafredri
commented
Aug 20, 2024
| _, 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) { |
Author
There was a problem hiding this comment.
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.
otiai10
reviewed
Aug 21, 2024
| Expect(t, err).ToBe(nil) | ||
|
|
||
| _, err = os.Stat(filepath.Join(subdir, dest)) | ||
| Expect(t, err).ToBe(nil) |
Owner
There was a problem hiding this comment.
// Note to myself @otiai10 : This line is failing as of now https://github.com/otiai10/copy/actions/runs/10471541423/job/29006044545?pr=162
otiai10
reviewed
Aug 21, 2024
| err := Copy("test/data/case18/assets", dest, Options{ | ||
| FS: os.DirFS("/"), | ||
| }) | ||
| Expect(t, err).ToBe(nil) |
Owner
There was a problem hiding this comment.
// Note to myself @otiai10 : This line is failing as of now https://github.com/otiai10/copy/actions/runs/10471541423/job/29006044545?pr=162
Owner
|
Thanks a lot! Let me take time to check it out 🙇 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/fsdoesn'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.