mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-15 20:23:50 -07:00
Add test case for --listen
This commit is contained in:
@@ -7,6 +7,7 @@ require 'English'
|
|||||||
require 'shellwords'
|
require 'shellwords'
|
||||||
require 'erb'
|
require 'erb'
|
||||||
require 'tempfile'
|
require 'tempfile'
|
||||||
|
require 'net/http'
|
||||||
|
|
||||||
TEMPLATE = DATA.read
|
TEMPLATE = DATA.read
|
||||||
UNSETS = %w[
|
UNSETS = %w[
|
||||||
@@ -2435,6 +2436,14 @@ class TestGoFZF < TestBase
|
|||||||
tmux.send_keys 'C-p'
|
tmux.send_keys 'C-p'
|
||||||
tmux.until { |lines| assert_includes lines, '>>2' }
|
tmux.until { |lines| assert_includes lines, '>>2' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_listen
|
||||||
|
tmux.send_keys 'seq 10 | fzf --listen 6266', :Enter
|
||||||
|
tmux.until { |lines| assert_equal 10, lines.item_count }
|
||||||
|
Net::HTTP.post(URI('http://localhost:6266'), 'change-query(yo)+reload(seq 100)+change-prompt:hundred> ')
|
||||||
|
tmux.until { |lines| assert_equal 100, lines.item_count }
|
||||||
|
tmux.until { |lines| assert_equal 'hundred> yo', lines[-1] }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module TestShell
|
module TestShell
|
||||||
|
Reference in New Issue
Block a user