Thread (47 messages) 47 messages, 4 authors, 2021-12-11

Re: [PATCH 06/19] t6300: make `%(raw:size) --shell` test more robust

From: Jeff King <hidden>
Date: 2021-12-10 09:14:19

On Thu, Dec 09, 2021 at 12:11:02AM -0500, Eric Sunshine wrote:
This test populates its `expect` file solely by appending content but
fails to ensure that the file starts out empty. The test succeeds only
because no earlier test populated a file of the exact same name, however
this is an accident waiting to happen. Make the test more robust by
ensuring that it contains exactly the intended content.
Agreed.
While at it, simplify the implementation via a straightforward `sed`
application and by avoiding dropping out of the single-quote context
within the test body (thus eliminating a hard-to-digest combination of
apostrophes and backslashes).
I find them equally ugly. :) The most confusing thing is that we are not
doing any shell quoting at all, just adding single-quote wrappers. But
that is OK because %(raw:size) should never need quoting.

Your solution seems fine to me.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help