mirror of
https://github.com/neovim/neovim.git
synced 2026-08-26 17:11:48 +00:00
fix(zip): missed "password:" prompt if output trails it #41364
Problem:
Flaky test:
RUN T1158 nvim.zip reports an incorrect archive password: 11092.84 ms FAIL
The prompt is detected only if the pty output *ends* with "password: ",
but a read may return the prompt plus following bytes.
Solution:
- Match anywhere in the output since the last password was sent. The
buffer is cleared before each send, so won't match stale text.
- Assert on the reported message, so a failure shows what was reported.
This commit is contained in:
@@ -198,8 +198,8 @@ local function extract_with_password(command, source, path, dir)
|
||||
|
||||
local function wanted()
|
||||
return exited ~= nil
|
||||
or buffered:find('password: $') ~= nil
|
||||
or buffered:find('reenter: $') ~= nil
|
||||
or buffered:find('password: ', 1, true) ~= nil
|
||||
or buffered:find('reenter: ', 1, true) ~= nil
|
||||
end
|
||||
|
||||
local reenter = false
|
||||
|
||||
Reference in New Issue
Block a user