-
Notifications
You must be signed in to change notification settings - Fork 41
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 support for GNU-compatible printf #120
Conversation
1911818
to
361fad3
Compare
Codecov Report
@@ Coverage Diff @@
## master #120 +/- ##
==========================================
+ Coverage 47.70% 49.80% +2.10%
==========================================
Files 18 19 +1
Lines 2111 2594 +483
Branches 495 702 +207
==========================================
+ Hits 1007 1292 +285
- Misses 933 1046 +113
- Partials 171 256 +85
Continue to review full report at Codecov.
|
Very strange test failure, it doesn't seem to be related to this PR. |
oh oops I had fixed it locally but forgot to push, just did it now |
Would it be possible to have high level tests? |
@sylvestre I added some high-level tests in |
b0c5bdf
to
e2bf11b
Compare
could you please move them into the tests directory? I prefer to have all integration tests at the same place. thanks |
@sylvestre Ah I misunderstood, just moved it over and actually testing the |
da16f97
to
f9ab584
Compare
Okay got CI on Windows working again with the moved tests 😅 Should be good now. (I also pointed it to uucore from Git so that it has the mentioned fix for grabbing the filesystem (otherwise |
thanks |
@sylvestre I added a few more tests, with that, though, most of the still-remaining red is things that can't easily be tested in CI due to a high dependence on host system config (e.g. filesystem type, block count, sparseness) |
c6998a7
to
eae08ae
Compare
(and CI is passing now, again) |
fails on ubuntu:
|
This adds initial support for GNU find-compatible printf syntax. As far as I can tell, it should implement all the specifiers, with the following exceptions: - Using zero as padding instead of space: GNU find isn't consistent with which numeric format specifiers support this. - Specifying precision (`%x.yz`): I believe sparseness (%S) and seconds-since-epoch (`%A@` / `%C@` / `%T@`) are the only ones that allow this, making it only partially useful. - Printing SELinux contexts (`%Z`): requires some extra dependencies and isn't within our scope. uucore is added as a dependency, because it has several utility functions that we need, the complexity of which is high enough that using the extra dependency is quite helpful. This also stubs out many of the specifiers for Windows, simply because I have no idea how these should work there. (The defaults chosen should be "good enough" for the moment, though.) Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
@sylvestre Well in retrospect, trying to use |
thanks and sorry for the latency :( |
This adds initial support for GNU find-compatible printf syntax. As far
as I can tell, it should implement all the specifiers, with the
following exceptions:
which numeric format specifiers support this.
%x.yz
): I believe sparseness (%S)and seconds-since-epoch (
%A@
/%C@
/%T@
) are the only ones thatallow this, making it only partially useful.
%Z
): requires some extra dependencies andisn't within our scope.
uucore is added as a dependency, because it has several utility
functions that we need, the complexity of which is high enough that
using the extra dependency is quite helpful.
This also stubs out many of the specifiers for Windows, simply because I
have no idea how these should work there. (The defaults chosen should be
"good enough" for the moment, though.)
Signed-off-by: Ryan Gonzalez ryan.gonzalez@collabora.com
Okay, so some more meta notes on this:
printer.rs
in favor of just puttingPrintf::new("%p").unwrap()
(which I believe should be identical) in the main file.