From d0dcece202a0b558e68b860bf7a4f70797b4d8a6 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 21 Oct 2020 23:49:00 +0200 Subject: [PATCH] t9391: guard `dos2unix` use behind a prereq Not all setups have `dos2unix`. Most notably, the Ubuntu and macOS agents of GitHub Actions don't. Signed-off-by: Johannes Schindelin --- t/t9391-filter-repo-lib-usage.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/t/t9391-filter-repo-lib-usage.sh b/t/t9391-filter-repo-lib-usage.sh index a8fa48f..761f43a 100755 --- a/t/t9391-filter-repo-lib-usage.sh +++ b/t/t9391-filter-repo-lib-usage.sh @@ -164,6 +164,11 @@ test_expect_success 'other error cases' ' ) ' +test_lazy_prereq DOS2UNIX ' + dos2unix -h + test $? -ne 127 +' + test_expect_success 'lint-history' ' test_create_repo lint-history && ( @@ -181,10 +186,13 @@ test_expect_success 'lint-history' ' git add content && git commit -m "oops, that was embarassing" && - $CONTRIB_DIR/lint-history --filenames-important dos2unix && - echo 2 >expect && - git rev-list --count HEAD >actual && - test_cmp expect actual + if test_have_prereq DOS2UNIX + then + $CONTRIB_DIR/lint-history --filenames-important dos2unix && + echo 2 >expect && + git rev-list --count HEAD >actual && + test_cmp expect actual + fi ) '