GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix both files can return an error by GunterSchmidt · Pull Request #188 · uutils/diffutils Conversation
Contributor
The PR #159 changed the integration test cannot_read_files to only check for at least one file-not-found-error. GNU diff returns one file-not-found-error for each of the two given files. This PR changes the test back (and includes the other utilities, as it was only run for 'diff') and I changed the code so that now both error message appear.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
GunterSchmidt
pushed a commit
to GunterSchmidt/diffutils
that referenced
this pull request
* ArgParser: removed default option, which does not exist in GNU diffutils * fix test 'cannot_read_files' (same as PR uutils#188) * merge test from PR uutils#159 Instead of 'fixing' the test, the program now acts like the GNU original and returns up to two error messages, one for each file.
sylvestre
force-pushed
the
Fix-both-files-can-return-an-error
branch
from
038f423 to
d446f97
Compare
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was an error while loading. Please reload this page.
Merging this PR will not alter performance
Comparing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,404 @@ | |||
| // This file is part of the uutils diffutils package. | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
is it related ? :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
are you still interested in this one? if not, i will close it, thanks |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| }; | ||
| let to_content = match read_file_contents(¶ms.to) { | ||
| Ok(to_content) => to_content, | ||
| let (from_content, to_content) = match utils::read_both_files(¶ms.from, ¶ms.to) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
on main, diff already printed both errors (and the test had count(2)). what does this fix for diff?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ); | ||
|
|
||
| io::stdout().write_all(&result).unwrap(); | ||
| if result.is_empty() { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
side_diff::diff always returns vec![], so this always exits 0 even when the files differ, no?
please add a test checking the exit code and output of sdiff
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ) -> String { | ||
| let mut msg = format_failure_to_read_input_file( | ||
| executable, | ||
| &errors[0].0, // filepath, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
panics if errors is empty and ignores anything after the second entry
could just iterate and join with '\n', no?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| )) | ||
| .count(2), | ||
| ); | ||
| // TODO test fails for cmp |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
why skip cmp? please fix it or open an issue
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| file2.write_all("bar\n".as_bytes())?; | ||
|
|
||
| let mut cmd = cargo_bin_cmd!("diffutils"); | ||
| cmd.arg("diff"); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
this runs diff, not sdiff :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
no news since my last ping, closing. reopen whenever you want to continue, thanks |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.