From d53a160cea6338969de96fe9e78d8a8441997e60 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 1 Feb 2024 17:04:15 +0900 Subject: [PATCH] More test fixes for tcell on GitHub Actions --- .github/workflows/linux.yml | 2 +- test/test_go.rb | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index eeed0dc1e44..d1f0890feca 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -42,7 +42,7 @@ jobs: run: make test - name: Integration test - run: make install && ./install --all && LC_ALL=C tmux new-session -d && ruby test/test_go.rb --verbose + run: make install && ./install --all && LC_ALL=C LANG=en_US.UTF-8 tmux new-session -d && ruby test/test_go.rb --verbose - name: Integration test (tcell) run: TAGS=tcell make clean install && ruby test/test_go.rb --verbose diff --git a/test/test_go.rb b/test/test_go.rb index 8abe2228974..ce2c439a1ac 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -967,6 +967,7 @@ def test_execute opts = %[--bind "alt-a:execute(echo /{}/ >> #{output})+change-header(alt-a),alt-b:execute[echo /{}{}/ >> #{output}]+change-header(alt-b),C:execute(echo /{}{}{}/ >> #{output})+change-header(C)"] writelines(tempname, %w[foo'bar foo"bar foo$bar]) tmux.send_keys "cat #{tempname} | #{fzf(opts)}", :Enter + tmux.until { |lines| assert_equal 3, lines.item_count } ready = ->(s) { tmux.until { |lines| assert_includes lines[-3], s } } tmux.send_keys :Escape, :a @@ -2184,14 +2185,15 @@ def test_preview_window_follow file = Tempfile.new('fzf-follow') file.sync = true - tmux.send_keys %(seq 100 | #{FZF} --preview 'tail -f "#{file.path}"' --preview-window follow --bind 'up:preview-up,down:preview-down,space:change-preview-window:follow|nofollow' --preview-window '~3'), :Enter + tmux.send_keys %(seq 100 | #{FZF} --preview 'echo start; tail -f "#{file.path}"' --preview-window follow --bind 'up:preview-up,down:preview-down,space:change-preview-window:follow|nofollow' --preview-window '~4'), :Enter tmux.until { |lines| lines.item_count == 100 } # Write to the temporary file, and check if the preview window is showing # the last line of the file + tmux.until { |lines| assert_includes lines[1], 'start' } 3.times { file.puts _1 } # header lines 1000.times { file.puts _1 } - tmux.until { |lines| assert_includes lines[1], '/1003' } + tmux.until { |lines| assert_includes lines[1], '/1004' } tmux.until { |lines| assert_includes lines[-2], '999' } # Scroll the preview window and fzf should stop following the file content @@ -2199,7 +2201,7 @@ def test_preview_window_follow tmux.until { |lines| assert_includes lines[-2], '998' } file.puts 'foo', 'bar' tmux.until do |lines| - assert_includes lines[1], '/1005' + assert_includes lines[1], '/1006' assert_includes lines[-2], '998' end @@ -2212,7 +2214,7 @@ def test_preview_window_follow end file.puts 'baz' tmux.until do |lines| - assert_includes lines[1], '/1006' + assert_includes lines[1], '/1007' assert_includes lines[-2], 'baz' end @@ -2221,7 +2223,7 @@ def test_preview_window_follow wait { assert_includes lines[-2], 'bar' } file.puts 'aaa' tmux.until do |lines| - assert_includes lines[1], '/1007' + assert_includes lines[1], '/1008' assert_includes lines[-2], 'bar' end @@ -2230,7 +2232,7 @@ def test_preview_window_follow tmux.until { |lines| assert_includes lines[-2], 'aaa' } file.puts 'bbb' tmux.until do |lines| - assert_includes lines[1], '/1008' + assert_includes lines[1], '/1009' assert_includes lines[-2], 'bbb' end @@ -2238,7 +2240,7 @@ def test_preview_window_follow tmux.send_keys :Space file.puts 'ccc', 'ddd' tmux.until do |lines| - assert_includes lines[1], '/1010' + assert_includes lines[1], '/1011' assert_includes lines[-2], 'bbb' end rescue StandardError