-
Notifications
You must be signed in to change notification settings - Fork 156
t: rework tests for --pathspec-from-file #503
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
t: rework tests for --pathspec-from-file #503
Conversation
/submit |
Submitted as pull.503.git.1577727747.gitgitgadget@gmail.com |
daef256
to
88086ce
Compare
/submit |
Submitted as pull.503.v2.git.1577733329.gitgitgadget@gmail.com |
88086ce
to
f71021b
Compare
/submit |
Submitted as pull.503.v3.git.1577786032.gitgitgadget@gmail.com |
/submit |
Error: f71021b was already submitted |
While working on the next patch, I also noticed that quotes testing via `"\"file\\101.t\""` was somewhat incorrect: I escaped `\` one time while I had to escape it two times! Tests still worked due to `"` being preserved which in turn prevented pathspec from matching files. Fix this by using here-doc instead. Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Previously, `parse_pathspec_file()` was tested indirectly by invoking git commands with properly crafted inputs. As demonstrated by the previous bugfix, testing complicated black boxes indirectly can lead to tests that silently test the wrong thing. Introduce direct tests for `parse_pathspec_file()`. Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
With direct tests for `parse_pathspec_file()` already in place, it is not very reasonable to copy&paste 6 similar indirect tests for every git command that uses `parse_pathspec_file()`. I counted 13 potential git commands, which could eventually lead to 6*13=78 duplicate tests. I believe that indirect tests are redundant because I don't expect direct tests to ever disagree with indirect tests. Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
f71021b
to
d02a1ea
Compare
/submit |
Submitted as pull.503.v4.git.1577787313.gitgitgadget@gmail.com |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Alexandr Miloslavskiy wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Alexandr Miloslavskiy wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
The first two patches were accepted via 6909474, but the last one was dropped. |
Uh oh!
There was an error while loading. Please reload this page.