-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add some test utils needed for major test refactoring #2011
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
Conversation
a538ae4 to
f8f1c5a
Compare
|
Ummm, just realized that track_caller is only available from Rust 1.46 and and the MSRV is 1.40. I can either remove it or, or add it conditionally with a |
c31522e to
5f3fcce
Compare
|
I like these changes in combination with #1982, however you should probably split this PR into multiple PRs. |
|
Sure, no problem. |
|
Yes more digestible is good :) |
|
Sure thing. |
2d7b1dd to
3fcc216
Compare
|
I love this change, many thanks :) it is possible to write some unit tests? |
|
Sure. Is there a test suite for the test utils? |
|
I meant to ask if it's a standard practice to test the test utils themselves. I'll add some |
bf3b37a to
c5d41a9
Compare
|
could you please fix the conflict? thanks |
|
@sylvestre Rebased over master |
In order to ease the reduction of CmdResult fields directly,
I've added the following measures:
CmdResult::{success,failure}andUCommand::{failed,succeeded}nowprint the stdout/stderr. This is done to reduce prints in tests. (as suggested here)
code_isthat asserts that return codestdout_onlywhich stated that it trims the string.stdoutorstdout_str().stdout_onlywhich claimed it was trimming the output.(some) Panicking utilities now hastrack_callerslapped on them to point accurately at the call location in the tests.On different PRs:
test_ls.rs. Remove some usage of CmdResult fields in tests #2034warning. Fixed panic!/assert! used with improper format strings #2033
There's probably a use for
stdout_trimmed(), since it's used in many places.After this PR, grepping the repo for the regex
\.stdout[^_\( ](with match-whole-word) returns only 156 in 18 files.