Add test case for --null option

This commit is contained in:
Junegunn Choi 2015-06-08 23:27:50 +09:00
parent 81ffde92fb
commit 45a3655eaf

View File

@ -536,6 +536,13 @@ class TestGoFZF < TestBase
ensure ensure
File.unlink tempname File.unlink tempname
end end
def test_null
lines = `find .`.split($/)
assert_equal lines.last, `find . | #{FZF} -e -f "^#{lines.last}$"`.chomp
assert_equal lines.last, `find . -print0 | #{FZF} --null -e -f "^#{lines.last}$"`.chomp
end
private private
def writelines path, lines def writelines path, lines
File.unlink path while File.exists? path File.unlink path while File.exists? path