Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concatenate some rendeing test #749

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 4 additions & 98 deletions test/reline/yamatanooroti/test_rendering.rb
Original file line number Diff line number Diff line change
@@ -556,7 +556,7 @@ def test_bracketed_paste
close
end

def test_bracketed_paste_with_undo
def test_bracketed_paste_with_undo_redo
omit if Reline.core.io_gate.win?
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
write("abc")
@@ -566,15 +566,6 @@ def test_bracketed_paste_with_undo
Multiline REPL.
prompt> abc
EOC
close
end

def test_bracketed_paste_with_redo
omit if Reline.core.io_gate.win?
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
write("abc")
write("\e[200~def hoge\r\t3\rend\e[201~")
write("\C-_")
write("\M-\C-_")
assert_screen(<<~EOC)
Multiline REPL.
@@ -639,46 +630,6 @@ def each_top_level_statement
prompt> end
prompt> end
EOC
close
end

def test_longer_than_screen_height_with_scroll_back
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
write(<<~EOC.chomp)
def each_top_level_statement
initialize_input
catch(:TERM_INPUT) do
loop do
begin
prompt
unless l = lex
throw :TERM_INPUT if @line == ''
else
@line_no += l.count("\n")
next if l == "\n"
@line.concat l
if @code_block_open or @ltype or @continue or @indent > 0
next
end
end
if @line != "\n"
@line.force_encoding(@io.encoding)
yield @line, @exp_line_no
end
break if @io.eof?
@line = ''
@exp_line_no = @line_no
#
@indent = 0
rescue TerminateLineInput
initialize_input
prompt
end
end
end
end
EOC
sleep 1
write("\C-p" * 6)
assert_screen(<<~EOC)
prompt> rescue Terminate
@@ -687,49 +638,9 @@ def each_top_level_statement
ut
prompt> prompt
EOC
close
end

def test_longer_than_screen_height_with_complex_scroll_back
start_terminal(4, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
write(<<~EOC.chomp)
def each_top_level_statement
initialize_input
catch(:TERM_INPUT) do
loop do
begin
prompt
unless l = lex
throw :TERM_INPUT if @line == ''
else
@line_no += l.count("\n")
next if l == "\n"
@line.concat l
if @code_block_open or @ltype or @continue or @indent > 0
next
end
end
if @line != "\n"
@line.force_encoding(@io.encoding)
yield @line, @exp_line_no
end
break if @io.eof?
@line = ''
@exp_line_no = @line_no
#
@indent = 0
rescue TerminateLineInput
initialize_input
prompt
end
end
end
end
EOC
sleep 1
write("\C-p" * 5)
write("\C-n" * 3)
write("\C-n" * 4)
assert_screen(<<~EOC)
prompt> initialize_inp
ut
prompt> prompt
prompt> end
@@ -1459,12 +1370,7 @@ def test_autocomplete_long_with_scrollbar
Socket
StringIO
EOC
close
end

def test_autocomplete_long_with_scrollbar_scroll
start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete-long}, startup_message: 'Multiline REPL.')
write('S' + "\C-i" * 16)
write("\C-i" * 16)
assert_screen(<<~'EOC')
Multiline REPL.
prompt> StringScanner
Loading