From 034d8ef68a9f1117a0cb08cad41dea2d36867def Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Fri, 3 Oct 2025 11:52:06 +0300 Subject: [PATCH] test(filedir): Workaround bug in bash 5.3 To fix CI failures, see https://github.com/scop/bash-completion/issues/1435 and https://lists.gnu.org/archive/html/bug-bash/2025-09/msg00332.html I made it catch the assertion so we won't have to run the version check for all tests. --- test/t/unit/test_unit_compgen_filedir.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/t/unit/test_unit_compgen_filedir.py b/test/t/unit/test_unit_compgen_filedir.py index aa18868c76d..2dc115bcd20 100644 --- a/test/t/unit/test_unit_compgen_filedir.py +++ b/test/t/unit/test_unit_compgen_filedir.py @@ -228,7 +228,21 @@ def test_26(self, bash, functions, funcname): completion = assert_complete( bash, r'%s "a\$b/' % funcname, cwd="_filedir" ) - assert completion == 'h"' + try: + assert completion == 'h"' + except AssertionError: + bash_version = assert_bash_exec( + bash, + r'printf "%s.%s\n" "${BASH_VERSINFO[0]}" "${BASH_VERSINFO[1]}"', + want_output=True, + ).strip() + # This is workaround for https://github.com/scop/bash-completion/issues/1435, see + # https://lists.gnu.org/archive/html/bug-bash/2025-09/msg00332.html + # Once this is fixed, the version check should be minimized further + if bash_version == "5.3": + assert completion.endswith('h" ') + else: + raise @pytest.mark.xfail(reason="TODO: non-ASCII issues with test suite?") @pytest.mark.parametrize("funcname", "f f2".split())