diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-08-26 23:35:31 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-08-26 23:35:31 +0900 |
commit | 80ed02e72ee3c5d408d1b8f5a81fb43e18a87ed1 (patch) | |
tree | bf41085306ecfe9fd00d64cab779399edcddd845 | |
parent | 8fb31e1b4d25ef20d039e919e8d7712d2ad6a96c (diff) |
Add failing test case for #329
-rw-r--r-- | test/test_go.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index c21c94e0..ba229bf4 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -774,6 +774,16 @@ class TestGoFZF < TestBase tmux.until { |lines| lines.any? { |l| l.include? 'Invalid $TERM: xxx' } } end + def test_with_nth + writelines tempname, ['hello world ', 'byebye'] + assert_equal 'hello world ', `cat #{tempname} | #{FZF} -f"^he hehe" -x -n 2.. --with-nth 2,1,1`.chomp + end + + def test_with_nth_ansi + writelines tempname, ["\x1b[33mhello \x1b[34;1mworld\x1b[m ", 'byebye'] + assert_equal 'hello world ', `cat #{tempname} | #{FZF} -f"^he hehe" -x -n 2.. --with-nth 2,1,1 --ansi`.chomp + end + private def writelines path, lines File.unlink path while File.exists? path |