m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 23:33:39 -05:00

Fix #248 - Premature termination of Reader on long input

This commit is contained in:
Junegunn Choi
2015-06-03 01:48:02 +09:00
parent fdbfe36c0b
commit b00bcf506e
2 changed files with 34 additions and 3 deletions

View File

@@ -525,6 +525,17 @@ class TestGoFZF < TestBase
tmux.send_keys 'uuu', 'TTT', 'tt', 'uu', 'ttt', 'C-j'
assert_equal %w[4 5 6 9], readonce.split($/)
end
def test_long_line
tempname = TEMPNAME + Time.now.to_f.to_s
data = '.' * 256 * 1024
File.open(tempname, 'w') do |f|
f << data
end
assert_equal data, `cat #{tempname} | #{FZF} -f .`.chomp
ensure
File.unlink tempname
end
private
def writelines path, lines
File.unlink path while File.exists? path