[PATCH v2 0/7] increase wildmatch test coverage
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Dec 25, 2017, 00:28 UTC
- Message-ID
- <20171225002835.29005-1-avarab@gmail.com>
- In-Reply-To
- <20171223213012.1962-1-avarab@gmail.com>
This v2 addresses comments by Johannes Sixt in <8f4cdb23-8e2e-144a-1f70-99776b027166@kdbg.org> and there's osme other cleanups as noted below.
Ævar Arnfjörð Bjarmason (7): wildmatch test: indent with tabs, not spaces wildmatch test: use more standard shell style
No changes.
wildmatch test: don't try to vertically align our output
NEW: Don't try to do whitespace alignment in the tests.
wildmatch test: use a paranoia pattern from nul_match()
Explain in the commit message why we're not using say '...'; exit 1. I said I'd use this in <874logs7vi.fsf@evledraar.gmail.com>, but on further consideration it's a bad idea.
wildmatch test: remove dead fnmatch() test code wildmatch test: perform all tests under all wildmatch() modes
Just changes to rebase them on the changes above.
wildmatch test: create & test files on disk in addition to in-memory
Avoid some forking by using a case statement instead of if .. grep && return.
Add comments to the code to clarify what it's doing.
Factoro out the repetitive part of the tests into functions, making the patch shorter.
I didn't change the "rm -rf -- *" pattern Johannes was concerned about, because after looking at it it would be a pain to create some-test-subdir/ and only if some-test-subdir/$our_file gets created cd to it and then remove it afterwards, it's much easier not to change the directory. The test test_when_finished always runs in the directory the tests executed in, so I don't see how this is dangerous in practice.
I didn't move the "printf" pattern to here-docs as discussed in the thread.
t/helper/test-wildmatch.c | 2 + t/t3070-wildmatch.sh | 759 +++++++++++++++++++++++++++++++--------------- 2 files changed, 516 insertions(+), 245 deletions(-)
-- 2.15.1.424.g9478a66081