diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-08-28 21:23:10 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-08-28 21:23:10 +0900 |
commit | 90b0cd44ac8fb9a6965c3dcf050f0e6aa2e90121 (patch) | |
tree | 2d1f49202779dfbcf797e3b7290f077f1b19bfe5 /test | |
parent | 698e8008df42d863af01a8da81f560f295f728ea (diff) |
Should not strip ANSI codes when --ansi is not set
Diffstat (limited to 'test')
-rw-r--r-- | test/test_go.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index ba229bf4..377af229 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -784,6 +784,12 @@ class TestGoFZF < TestBase assert_equal 'hello world ', `cat #{tempname} | #{FZF} -f"^he hehe" -x -n 2.. --with-nth 2,1,1 --ansi`.chomp end + def test_with_nth_no_ansi + src = "\x1b[33mhello \x1b[34;1mworld\x1b[m " + writelines tempname, [src, 'byebye'] + assert_equal src, `cat #{tempname} | #{FZF} -fhehe -x -n 2.. --with-nth 2,1,1 --no-ansi`.chomp + end + private def writelines path, lines File.unlink path while File.exists? path |