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 file_mode_has and file_mode_hasnt #11

merged 2 commits into from Jan 13, 2015


None yet
2 participants

rjbs commented Jan 13, 2015

(This PR is being filed against my CPAN Pull Request Challenge, but I think these functions are
genuinely useful.)

This commit adds two new tests which behave like file_mode_is and file_mode_isnt, but do not require an exact match between the wanted and found modes. Instead, you can just specify a mask that must be entirely present or absent. I've also added diagnostics that will tell you how you failed, if you failed. ("You said you need 0110 but you're missing the 0010 part.")

If you think that's all useful, I may give you a follow-up PR to add diagnostics to the _is and _isnt
forms to have diagnostics indicating what you have versus what you want.

rjbs added some commits Jan 13, 2015

indent the (tiny) synopsis code
...that way, we get a nice-looking code block when formatted
add file_mode_has and file_mode_hasnt
These are like file_mode_is/isnt, but check that a set of bits
are set or unset without worrying about the rest of the mode.  If
these tests are not okay, they provide diagnostics of the specific
bits that were set or unset incorrectly.

briandfoy added a commit that referenced this pull request Jan 13, 2015

Merge pull request #11 from rjbs/file_mode_has
add file_mode_has and file_mode_hasnt

@briandfoy briandfoy merged commit e3dcfd0 into briandfoy:master Jan 13, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment