Re: [GSOC][RFC] microproject: use test_path_is_* functions in test scripts
- From
vincenzo mezzela <vincenzo.mezzela@gmail.com>
- Date
- Feb 14, 2024, 10:20 UTC
- Message-ID
- <CAF2+nma0HZUPevhT7A4vM0rFYF07eF_u9Sg2wRAQ8E2+qBj5uQ@mail.gmail.com>
- In-Reply-To
- <xmqqy1bo5k5h.fsf@gitster.g>
Show 8 quoted lines
> One thing to note is that you'd need to make sure if "test -e" for > example originally written really means "we want to see something > there and it does not matter if it is a file or a directory" while > turning it into test_path_exists. The operations that such a test > follows may be expected to create a file and never a directory, in > which case the condition the original code is testing may need to > be corrected first to expect a more specific type (e.g. "test -f"). > The same comment applies for the other two.
Thanks for this clarification!
> Some tests check with "! test -f <path>", which often would want to > be turned into "test_path_is_missing", but you'd need to make sure > that is what the original test really meant to do.
I'd have changed them into: - ! test -f <path> --> ! test_path_is_file <path> - ! test -e <path> --> test_path_is_missing <path> Since '! test -f <path>' and 'test_path_is_missing <path>' can return different values.
But as you said, I'll check what they are really meant to do and modify them accordingly :)
Show 11 quoted lines
> > A microproject is not about "doing the real work to help the > project". It is a practice session to come up with a set of small > changes and explain them well, to send the result to the list to get > reviewed, to respond to reviews and possibly send updates, and to > repeat the cycle until completion. So most likely you'd pick a > single file or two and do the above conversion, while leaving the > others as practice material for other GSoC participants. > > Enjoy. >
Thanks for this clarification too. :)
Vincenzo