diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2018-01-30 21:21:21 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-01-30 14:04:01 -0800 |
commit | 91061c444a245b967a97b84b01a11bbe077c3477 (patch) | |
tree | f99495784fc94018c2ede1e9a232937b5ca9dfff /t/helper | |
parent | wildmatch test: use test_must_fail, not ! for test-wildmatch (diff) | |
download | tgif-91061c444a245b967a97b84b01a11bbe077c3477.tar.xz |
wildmatch test: perform all tests under all wildmatch() modes
Rewrite the wildmatch() test suite so that each test now tests all
combinations of the wildmatch() WM_CASEFOLD and WM_PATHNAME flags.
Before this change some test inputs were not tested on
e.g. WM_PATHNAME. Now the function is stress tested on all possible
inputs, and for each input we declare what the result should be if the
mode is case-insensitive, or pathname matching, or case-sensitive or
not matching pathnames.
Also before this change, nothing was testing case-insensitive
non-pathname matching, so I've added that to test-wildmatch.c and made
use of it.
This yields a rather scary patch, but there are no functional changes
here, just more test coverage. Some now-redundant tests were deleted
as a result of this change, since they were now duplicating an earlier
test.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
-rw-r--r-- | t/helper/test-wildmatch.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/t/helper/test-wildmatch.c b/t/helper/test-wildmatch.c index 921d7b3e7e..66d33dfcfd 100644 --- a/t/helper/test-wildmatch.c +++ b/t/helper/test-wildmatch.c @@ -16,6 +16,8 @@ int cmd_main(int argc, const char **argv) return !!wildmatch(argv[3], argv[2], WM_PATHNAME | WM_CASEFOLD); else if (!strcmp(argv[1], "pathmatch")) return !!wildmatch(argv[3], argv[2], 0); + else if (!strcmp(argv[1], "ipathmatch")) + return !!wildmatch(argv[3], argv[2], WM_CASEFOLD); else return 1; } |