t9811: reformat and modernize tests
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest2 patches 1 replyIn review
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | t9811: break long && chains into multiple linest/ | +15 | 0 replies | |
| 2/2 | t9811: replace 'test -f' and '! test -f' with 'test_path_*'t/ | +10 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by.
| Patch | Vinicius Lira de Freitas |
|---|---|
| 1/2 | Co-authored-by |
| 2/2 | Co-authored-by |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] t9811: reformat and modernize tests
This patch series reformats and modernizes the t9811 tests. Changes since v1:
- Break long && chains into multiple lines according to how git tests are written nowadays. This was suggested by Patrick Steinhardt.
- Replace 'test -f' calls by more useful 'test_path_*' helpers as the second commit in the series.
Marcelo Machado Lage (2):
t9811: break long && chains into multiple lines
t9811: replace 'test -f' and '! test -f' with 'test_path_*'
t/t9811-git-p4-label-import.sh | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-)
Range-diff against v1:
-: ---------- > 1: 0f03c913eb t9811: break long && chains into multiple lines
1: f319f2e6e7 ! 2: 3e590881c3 t9811: replace 'test -f' and '! test -f' with 'test_path_*'
@@ Commit message
Replace the basic shell commands 'test -f', with more modern test
helpers 'test_path_is_file' and 'test_path_is_missing'.
+ These modern helpers emit useful information when the corresponding
+ tests fail, unlike 'test -f' and '! test -f'.
+
+ The occurrences of '! test -f filename' were replaced by
+ 'file_path_is_missing filename', a stronger guarantee equivalent to
+ '! test -e filename'.
+
+ Co-authored-by: Vinicius Lira de Freitas <[email protected]>
+ Signed-off-by: Vinicius Lira de Freitas <[email protected]>
+ Signed-off-by: Marcelo Machado Lage <[email protected]>
## t/t9811-git-p4-label-import.sh ##
@@ t/t9811-git-p4-label-import.sh: test_expect_success 'basic p4 labels' '
@@ t/t9811-git-p4-label-import.sh: test_expect_success 'basic p4 labels' '
- ! test -f f2 &&
+ test_path_is_missing f2 &&
git checkout TAG_WITH\$_SHELL_CHAR &&
-- test -f f1 && test -f f2 && test -f file_with_\$metachar &&
-+ test_path_is_file f1 && test_path_is_file f2 && test_path_is_file file_with_\$metachar &&
+- test -f f1 &&
+- test -f f2 &&
+- test -f file_with_\$metachar &&
++ test_path_is_file f1 &&
++ test_path_is_file f2 &&
++ test_path_is_file file_with_\$metachar &&
git show TAG_LONG_LABEL | grep -q "A Label second line"
)Signature · 1 line
2.34.1