Skip to content

Commit 6e6f09b

Browse files
committed
test(cryptsetup): update the skip condition
1 parent e7ee078 commit 6e6f09b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

completions/cryptsetup

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ _comp_cmd_cryptsetup__device()
1313
_comp_cmd_cryptsetup__action()
1414
{
1515
local REPLY IFS=$' \t\n'
16-
_comp_dequote "$1" || return 1
16+
_comp_dequote "${1-}" || return 1
1717
local cmd=${REPLY:-cryptsetup}
1818
local -a actions
1919
_comp_split -l actions "$(
@@ -46,7 +46,7 @@ _comp_cmd_cryptsetup__action()
4646
filtering_pattern=${filtering_pattern%$'\n'}
4747

4848
local filtered_actions
49-
filtered_actions=$(strings "$path" | grep -Fx "$filtering_pattern" | sort -u) &&
49+
filtered_actions=$(strings "$path" | command grep -Fx "$filtering_pattern" | sort -u) &&
5050
[[ $filtered_actions ]] &&
5151
_comp_split -l actions "$filtered_actions"
5252
fi

test/t/test_cryptsetup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_2(self, completion):
1313
@pytest.mark.complete(
1414
"cryptsetup luksE",
1515
require_cmd=True,
16-
skipif='! strings "$(type -P cryptsetup)" | grep -qFx luksErase',
16+
skipif=r'! { cryptsetup --help; man cryptsetup; } 2>/dev/null | command grep -qE "(^|[[:space:]])luksErase([[:space:]]|\$)"',
1717
)
1818
def test_github_issue758(self, completion):
1919
assert completion == "rase"

0 commit comments

Comments
 (0)