1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] Add a test for pasting Cyrillic chars into command prompt on cp 850

This closes https://github.com/ruby/reline/issues/103.

https://github.com/ruby/reline/commit/213e0523d5
This commit is contained in:
aycabta 2021-04-22 14:02:37 +09:00
parent b0cc46b484
commit 754bfc66f8

View file

@ -753,6 +753,28 @@ begin
EOC
end
def test_cyrillic_chars
omit unless Reline::IOGate.win?
start_terminal(50, 50, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
write("`chcp 850`\n")
write("`chcp`\n")
write("def гопота; 3; end\n")
write("гопота\n")
close
assert_screen(<<~'EOC')
Multiline REPL.
prompt> `chcp 850`
=> "Active code page: 850\n"
prompt> `chcp`
=> "Active code page: 850\n"
prompt> def гопота; 3; end
=> :гопота
prompt> гопота
=> 3
prompt>
EOC
end
private def write_inputrc(content)
File.open(@inputrc_file, 'w') do |f|
f.write content