Skip to content
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

Fix file/dir mode helpers and tests #166

Merged
merged 2 commits into from
Aug 21, 2024
Merged

Conversation

brandondyck
Copy link
Contributor

  • FileMode and DirMode now use os.Stat rather than fs.Stat, and I updated their tests to be OS-agnostic. (For info on Windows permission limitations, see https://archive.is/RZ8WP and https://git.codemonkeysoftware.net/b/go-perm-test.) I also removed brokenfs` because it's no longer used.
  • The tests for FileModeFS and DirModeFS now use fstest.MapFS (which I was very happy to discover yesterday) instead of os.DirFS and Linux-specific paths. The tests are no longer skipped on non-Linux systems.
  • FileModeFS and DirModeFS tests are a little more thorough.
  • I eliminated the noise from running tests by changing internalTest to only print captured messages when the test fails.

Copy link
Owner

@shoenig shoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks again @brandondyck!

@shoenig shoenig merged commit 2e48df0 into shoenig:main Aug 21, 2024
6 checks passed
@brandondyck brandondyck deleted the mode-tests branch August 27, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants