From f25dc419c7450d2a459e6372af25d5831d0fbaec Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 14 Aug 2024 19:12:49 +1000 Subject: More test timing fix --- test/shell/prompt-shell-script-candidates/script | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'test/shell') diff --git a/test/shell/prompt-shell-script-candidates/script b/test/shell/prompt-shell-script-candidates/script index 231c8725..33cf94ab 100644 --- a/test/shell/prompt-shell-script-candidates/script +++ b/test/shell/prompt-shell-script-candidates/script @@ -1,7 +1,5 @@ -ui_out -ignore 7 +ui_out -until '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ":foob" ] }' -ui_out -ignore 4 -ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [false] }' -ui_out -ignore 3 -ui_out '{ "jsonrpc": "2.0", "method": "menu_show", "params": [[[{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "bar" }]], { "line": 0, "column": 0 }, { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, { "fg": "blue", "bg": "white", "underline": "default", "attributes": [] }, "prompt"] }' +ui_out -until '{ "jsonrpc": "2.0", "method": "refresh", "params": [false] }' +ui_out -until '{ "jsonrpc": "2.0", "method": "menu_show", "params": [[[{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "bar" }]], { "line": 0, "column": 0 }, { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, { "fg": "blue", "bg": "white", "underline": "default", "attributes": [] }, "prompt"] }' ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "" ] }' -- cgit v1.2.3 From ca7bc55cf5134b11451ca6b88d9fa0205bbaac66 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 22 Oct 2024 21:18:23 +1100 Subject: Run shell-script-completions asynchronously Share most logic with shell-script-candidates. Now that we do not block we can run the completion script implicitely instead of waiting for an explicit completion request with . Fixes #5245 --- test/shell/prompt-shell-script-completion/cmd | 2 +- test/shell/prompt-shell-script-completion/rc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'test/shell') diff --git a/test/shell/prompt-shell-script-completion/cmd b/test/shell/prompt-shell-script-completion/cmd index 7cc38390..8b137891 100644 --- a/test/shell/prompt-shell-script-completion/cmd +++ b/test/shell/prompt-shell-script-completion/cmd @@ -1 +1 @@ -:foob + diff --git a/test/shell/prompt-shell-script-completion/rc b/test/shell/prompt-shell-script-completion/rc index 3fd111ba..f7175986 100644 --- a/test/shell/prompt-shell-script-completion/rc +++ b/test/shell/prompt-shell-script-completion/rc @@ -1,3 +1,4 @@ +set-option global autocomplete prompt define-command foo %{ - prompt -shell-script-completion %{ printf 'foo\nbar\nhaz\n' } ': ' %{exec i %val{text} } + prompt -shell-script-completion %{ printf 'foo\nbar\nbaz\n' } ': ' %{exec i %val{text} } } -- cgit v1.2.3 From 7b18d5e1be5131f3afeff7c9fcc12fd01dfa9422 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 22 Oct 2024 21:26:11 +1100 Subject: Add missing test file --- test/shell/prompt-shell-script-completion/script | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/shell/prompt-shell-script-completion/script (limited to 'test/shell') diff --git a/test/shell/prompt-shell-script-completion/script b/test/shell/prompt-shell-script-completion/script new file mode 100644 index 00000000..768a63bd --- /dev/null +++ b/test/shell/prompt-shell-script-completion/script @@ -0,0 +1,5 @@ +ui_out -until '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ":foob" ] }' +ui_out -until '{ "jsonrpc": "2.0", "method": "refresh", "params": [false] }' +ui_out -until '{ "jsonrpc": "2.0", "method": "menu_show", "params": [[[{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "foo" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "bar" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "baz" }]], { "line": 0, "column": 0 }, { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, { "fg": "blue", "bg": "white", "underline": "default", "attributes": [] }, "prompt"] }' +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "" ] }' -- cgit v1.2.3