wildmatch test: perform all tests under all wildmatch() modes
commit91061c444a245b967a97b84b01a11bbe077c3477
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 30 Jan 2018 21:21:21 +0000 (30 21:21 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Jan 2018 22:04:01 +0000 (30 14:04 -0800)
treef99495784fc94018c2ede1e9a232937b5ca9dfff
parent4bc280f25098c60c7e6eef4b0277a94925ed4c11
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>
t/helper/test-wildmatch.c
t/t3070-wildmatch.sh