From 3c046dd1d4bcde712868d914d261eb4b34b9f643 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 18 Jun 2022 10:19:39 +0900 Subject: [PATCH] test(cryptsetup): update the skip condition --- completions/cryptsetup | 4 ++-- test/t/test_cryptsetup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/completions/cryptsetup b/completions/cryptsetup index db77103e094..11ad285446b 100644 --- a/completions/cryptsetup +++ b/completions/cryptsetup @@ -14,7 +14,7 @@ _cryptsetup_device() _cryptsetup_action() { local ret IFS=$' \t\n' - _comp_dequote "$1" || return 1 + _comp_dequote "${1-}" || return 1 local cmd=${ret:-cryptsetup} local actions=$( { @@ -46,7 +46,7 @@ _cryptsetup_action() filtering_pattern=${filtering_pattern%$'\n'} local filtered_actions - filtered_actions=$(strings "$path" | grep -Fx "$filtering_pattern" | sort -u) && + filtered_actions=$(strings "$path" | command grep -Fx "$filtering_pattern" | sort -u) && [[ $filtered_actions ]] && actions=$filtered_actions fi diff --git a/test/t/test_cryptsetup.py b/test/t/test_cryptsetup.py index 51a42f19c85..d3fa9fb055d 100644 --- a/test/t/test_cryptsetup.py +++ b/test/t/test_cryptsetup.py @@ -13,7 +13,7 @@ def test_2(self, completion): @pytest.mark.complete( "cryptsetup luksE", require_cmd=True, - skipif='! strings "$(type -P cryptsetup)" | grep -qFx luksErase', + skipif=r'! { cryptsetup --help; man cryptsetup; } 2>/dev/null | command grep -qE "(^|[[:space:]])luksErase([[:space:]]|\$)"', ) def test_github_issue758(self, completion): assert completion == "rase"