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

New yamatanooroti for win #776

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
60 changes: 49 additions & 11 deletions test/reline/yamatanooroti/test_rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ def test_autowrap
end

def test_fullwidth
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
unless Yamatanooroti.win? && Yamatanooroti.options.windows == :"legacy-conhost"
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
else
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.', codepage: 932)
omit "codepage 932 not supported" if !codepage_success?
end
write(":あ\n")
assert_screen(<<~EOC)
Multiline REPL.
Expand All @@ -101,7 +106,12 @@ def test_fullwidth
end

def test_two_fullwidth
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
unless Yamatanooroti.win? && Yamatanooroti.options.windows == :"legacy-conhost"
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
else
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.', codepage: 932)
omit "codepage 932 not supported" if !codepage_success?
end
write(":あい\n")
assert_screen(<<~EOC)
Multiline REPL.
Expand Down Expand Up @@ -377,7 +387,12 @@ def test_clear_multiline_and_autowrap
end

def test_nearest_cursor
start_terminal(10, 20, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
unless Yamatanooroti.win? && Yamatanooroti.options.windows == :"legacy-conhost"
start_terminal(10, 20, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
else
start_terminal(10, 20, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.', codepage: 932)
omit "codepage 932 not supported" if !codepage_success?
end
write("def ああ\n :いい\nend\C-pbb\C-pcc")
assert_screen(<<~EOC)
Multiline REPL.
Expand Down Expand Up @@ -718,7 +733,12 @@ def test_auto_indent_when_inserting_line
end

def test_auto_indent_multibyte_insert_line
start_terminal(10, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --auto-indent}, startup_message: 'Multiline REPL.')
unless Yamatanooroti.win? && Yamatanooroti.options.windows == :"legacy-conhost"
start_terminal(10, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --auto-indent}, startup_message: 'Multiline REPL.')
else
start_terminal(10, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --auto-indent}, startup_message: 'Multiline REPL.', codepage: 932)
omit "codepage 932 not supported" if !codepage_success?
end
write "if true\n"
write "あいうえお\n"
4.times { write "\C-b\C-b\C-b\C-b\e\r" }
Expand Down Expand Up @@ -763,7 +783,12 @@ def test_suppress_auto_indent_just_after_pasted
end

def test_suppress_auto_indent_for_adding_newlines_in_pasting
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --auto-indent}, startup_message: 'Multiline REPL.')
unless Yamatanooroti.win? && Yamatanooroti.options.windows == :"legacy-conhost"
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --auto-indent}, startup_message: 'Multiline REPL.')
else
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --auto-indent}, startup_message: 'Multiline REPL.', codepage: 932)
omit "codepage 932 not supported" if !codepage_success?
end
write("<<~Q\n")
write("{\n #\n}")
write("#")
Expand Down Expand Up @@ -854,7 +879,12 @@ def test_meta_key
end

def test_not_meta_key
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
unless Yamatanooroti.win? && Yamatanooroti.options.windows == :"legacy-conhost"
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
else
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.', codepage: 932)
omit "codepage 932 not supported" if !codepage_success?
end
write("おだんご") # "だ" in UTF-8 contains "\xA0"
assert_screen(<<~EOC)
Multiline REPL.
Expand Down Expand Up @@ -1220,12 +1250,15 @@ def test_simple_dialog_scrollbar_with_moving_to_left

def test_dialog_with_fullwidth_chars
ENV['RELINE_TEST_PROMPT'] = '> '
start_terminal(20, 5, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog fullwidth,scrollkey,scrollbar}, startup_message: 'Multiline REPL.')
unless Yamatanooroti.win? && Yamatanooroti.options.windows == :"legacy-conhost"
start_terminal(20, 5, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog fullwidth,scrollkey,scrollbar}, startup_message: 'Multiline REPL.')
else
start_terminal(20, 5, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog fullwidth,scrollkey,scrollbar}, startup_message: 'Multiline REPL.', codepage: 932)
omit "codepage 932 not supported" if !codepage_success?
end
write("\C-l")
6.times{ write('j') }
assert_screen(<<~'EOC')
Multi
line
REPL.
>
オー
グ言▄
Expand All @@ -1237,7 +1270,12 @@ def test_dialog_with_fullwidth_chars

def test_dialog_with_fullwidth_chars_split
ENV['RELINE_TEST_PROMPT'] = '> '
start_terminal(20, 6, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog fullwidth,scrollkey,scrollbar}, startup_message: 'Multiline REPL.')
unless Yamatanooroti.win? && Yamatanooroti.options.windows == :"legacy-conhost"
start_terminal(20, 6, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog fullwidth,scrollkey,scrollbar}, startup_message: 'Multiline REPL.')
else
start_terminal(20, 6, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog fullwidth,scrollkey,scrollbar}, startup_message: 'Multiline REPL.', codepage: 932)
omit "codepage 932 not supported" if !codepage_success?
end
6.times{ write('j') }
assert_screen(<<~'EOC')
Multil
Expand Down
Loading