m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 07:43:39 -05:00

Add GET endpoints for getting the state of the finder

* GET / (or GET /current)
* GET /query
This commit is contained in:
Junegunn Choi
2022-12-25 16:27:02 +09:00
parent de0da86bd7
commit 750b2a6313
6 changed files with 66 additions and 22 deletions

View File

@@ -2440,9 +2440,12 @@ class TestGoFZF < TestBase
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> ')
Net::HTTP.post(URI('http://localhost:6266'), 'change-query(00)+reload(seq 100)+change-prompt:hundred> ')
tmux.until { |lines| assert_equal 100, lines.item_count }
tmux.until { |lines| assert_equal 'hundred> yo', lines[-1] }
tmux.until { |lines| assert_equal 'hundred> 00', lines[-1] }
assert_equal '100', Net::HTTP.get(URI('http://localhost:6266'))
assert_equal '100', Net::HTTP.get(URI('http://localhost:6266/current'))
assert_equal '00', Net::HTTP.get(URI('http://localhost:6266/query'))
end
end