mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] Add tests for dialog with fullwidth chars and corner cases
35ab5d47a8
This commit is contained in:
parent
391d6ab4f7
commit
3112e876a1
2 changed files with 43 additions and 0 deletions
|
@ -55,6 +55,15 @@ opt.on('--dialog VAL') { |v|
|
||||||
natural to read
|
natural to read
|
||||||
and easy to write.
|
and easy to write.
|
||||||
RUBY
|
RUBY
|
||||||
|
elsif v.include?('fullwidth')
|
||||||
|
contents = <<~RUBY.split("\n")
|
||||||
|
Rubyとは...
|
||||||
|
|
||||||
|
オープンソースの動的なプログラミン
|
||||||
|
グ言語で、シンプルさと高い生産性を
|
||||||
|
備えています。エレガントな文法を持
|
||||||
|
ち、自然に読み書きができます。
|
||||||
|
RUBY
|
||||||
end
|
end
|
||||||
if v.include?('scrollkey')
|
if v.include?('scrollkey')
|
||||||
dialog.trap_key = nil
|
dialog.trap_key = nil
|
||||||
|
|
|
@ -935,6 +935,40 @@ begin
|
||||||
EOC
|
EOC
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_dialog_with_fullwidth_chars
|
||||||
|
ENV['RELINE_TEST_PROMPT'] = '> '
|
||||||
|
start_terminal(30, 5, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog fullwidth,scrollkey,scrollbar}, startup_message: 'Multiline REPL.')
|
||||||
|
6.times{ write('j') }
|
||||||
|
close
|
||||||
|
assert_screen(<<~'EOC')
|
||||||
|
Multi
|
||||||
|
line
|
||||||
|
REPL.
|
||||||
|
>
|
||||||
|
オー
|
||||||
|
グ言▄
|
||||||
|
備え█
|
||||||
|
ち、█
|
||||||
|
EOC
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_dialog_with_fullwidth_chars_split
|
||||||
|
ENV['RELINE_TEST_PROMPT'] = '> '
|
||||||
|
start_terminal(30, 6, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog fullwidth,scrollkey,scrollbar}, startup_message: 'Multiline REPL.')
|
||||||
|
6.times{ write('j') }
|
||||||
|
close
|
||||||
|
assert_screen(<<~'EOC')
|
||||||
|
Multil
|
||||||
|
ine RE
|
||||||
|
PL.
|
||||||
|
>
|
||||||
|
オー
|
||||||
|
グ言 ▄
|
||||||
|
備え █
|
||||||
|
ち、 █
|
||||||
|
EOC
|
||||||
|
end
|
||||||
|
|
||||||
def test_autocomplete_empty
|
def test_autocomplete_empty
|
||||||
start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete}, startup_message: 'Multiline REPL.')
|
start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --autocomplete}, startup_message: 'Multiline REPL.')
|
||||||
write('Street')
|
write('Street')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue