From c48b02e418f3ffaa5281dcae43d0a0a7b17ff842 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 27 Jan 2022 04:06:09 +0100 Subject: [PATCH] fixup! Fix commandline state for custom completions with variable overrides The previous commit added transient commandlines when completing commands with variable overrides. Transient commandlines require a parser, but perform_one_completion_cd_test() asked for completions without giving a parser, which is only okay when asking for autosuggestions (like perform_one_autosuggestion_cd_test() does). Let's pass a parser to fix the test. --- src/fish_tests.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index c99c15d3b..646cfcdac 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -3574,7 +3574,8 @@ static void perform_one_autosuggestion_cd_test(const wcstring &command, const wc static void perform_one_completion_cd_test(const wcstring &command, const wcstring &expected, const environment_t &vars, long line) { - completion_list_t comps = complete(command, {}, operation_context_t{vars}); + completion_list_t comps = complete( + command, {}, operation_context_t{parser_t::principal_parser().shared(), vars, no_cancel}); bool expects_error = (expected == L"");