summaryrefslogtreecommitdiff
path: root/test/irb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-02-26 10:32:34 +0900
committerGitHub <noreply@github.com>2021-02-26 10:32:34 +0900
commit46825a7462e3106599c034bd77dcd3646a181539 (patch)
tree7db115b34669e3e2cadc51e28e92319ac0ee849b /test/irb
parent551f1236a43ad014522d120dea1f136052879c0a (diff)
Backport lib/reline, and lib/irb for 3.0.1 3rd (#4228)
* [ruby/irb] Suppress error when File::ALT_SEPARATOR is nil https://github.com/ruby/irb/commit/96accf3b95 * [ruby/irb] Suppress colorize on Windows tests https://github.com/ruby/irb/commit/5be9354cf9 * [ruby/irb] The command "irb_info" should show RUBY_PLATFORM https://github.com/ruby/irb/commit/39d1cd874f * [ruby/irb] Fix inverse separator condition https://github.com/ruby/irb/commit/33f933196f * [ruby/reline] Return 1 when char width not found This fixes ruby/reline#261. https://github.com/ruby/reline/commit/3cf1213014 * [ruby/reline] Avoid tripping over nil prompt https://github.com/ruby/reline/commit/d4d9d3e3d4 * [ruby/reline] Move script files for yamatanooroti tests https://github.com/ruby/reline/commit/03031b885d * [ruby/reline] Add a test for suppressing crash when dynamic prompt returns empty ref. https://github.com/ruby/reline/pull/262 https://github.com/ruby/reline/commit/b98bc3c329 * [ruby/reline] We still need support new and legacy behavior. Revert "Support for change in Windows-specific behavior at eol" This reverts commit cad4de6ee841b43f3f0e441626f9415c3eda0f82. https://github.com/ruby/reline/commit/646587fc2c * [ruby/reline] check ENABLE_VIRTUAL_TERMINAL_PROCESSING flag and switch eof processing https://github.com/ruby/reline/commit/3535676689 * [ruby/reline] Use UTF-8 only for width calc, rest uses original encoding I confirmed that libvterm supports only which are UTF-8, US ASCII, UK, and DEC graphics by reading source code, so can't test this patch by yamatanoorogi gem through vterm gem for now. This fixes ruby/irb#190. https://github.com/ruby/reline/commit/44596c0cc7 * [ruby/reline] fix Reline::Windows.getconsolemode buffer use double quotes to properly convert the \000 escape sequence. https://github.com/ruby/reline/commit/236dfe5683 * [ruby/irb] Version 1.3.4 https://github.com/ruby/irb/commit/ab9852ccc5 * [ruby/reline] Version 0.2.4 https://github.com/ruby/reline/commit/462f971bd3 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Eamonn Webster <eamonn.webster@gmail.com> Co-authored-by: Yoshinao Muramatu <ysno@ac.auone-net.jp> Co-authored-by: cremno <cremno@mail.ru>
Diffstat (limited to 'test/irb')
-rw-r--r--test/irb/test_cmd.rb8
-rw-r--r--test/irb/test_workspace.rb6
2 files changed, 12 insertions, 2 deletions
diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb
index 7219473e4c..41f84f1922 100644
--- a/test/irb/test_cmd.rb
+++ b/test/irb/test_cmd.rb
@@ -48,7 +48,8 @@ module TestIRB
Ruby\sversion: .+\n
IRB\sversion:\sirb .+\n
InputMethod:\sReidlineInputMethod\swith\sReline .+ and .+\n
- \.irbrc\spath: .+
+ \.irbrc\spath: .+\n
+ RUBY_PLATFORM: .+
}x
assert_match expected, irb.context.main.irb_info.to_s
end
@@ -67,7 +68,8 @@ module TestIRB
Ruby\sversion: .+\n
IRB\sversion:\sirb .+\n
InputMethod:\sReadlineInputMethod\swith .+ and .+\n
- \.irbrc\spath: .+
+ \.irbrc\spath: .+\n
+ RUBY_PLATFORM: .+
}x
assert_match expected, irb.context.main.irb_info.to_s
end
@@ -89,6 +91,7 @@ module TestIRB
Ruby\sversion: .+\n
IRB\sversion:\sirb .+\n
InputMethod:\sReidlineInputMethod\swith\sReline\s[^ ]+(?!\sand\s.+)\n
+ RUBY_PLATFORM: .+\n
\z
}x
assert_match expected, irb.context.main.irb_info.to_s
@@ -115,6 +118,7 @@ module TestIRB
Ruby\sversion: .+\n
IRB\sversion:\sirb .+\n
InputMethod:\sReadlineInputMethod\swith\s(?~.*\sand\s.+)\n
+ RUBY_PLATFORM: .+\n
\z
}x
assert_match expected, irb.context.main.irb_info.to_s
diff --git a/test/irb/test_workspace.rb b/test/irb/test_workspace.rb
index 15c77315a8..f028fc3aa2 100644
--- a/test/irb/test_workspace.rb
+++ b/test/irb/test_workspace.rb
@@ -9,6 +9,7 @@ require 'irb/color'
module TestIRB
class TestWorkSpace < Test::Unit::TestCase
def test_code_around_binding
+ IRB.conf[:USE_COLORIZE] = false
Tempfile.create('irb') do |f|
code = <<~RUBY
# 1
@@ -33,6 +34,8 @@ module TestIRB
EOS
end
+ ensure
+ IRB.conf.delete(:USE_COLORIZE)
end
def test_code_around_binding_with_existing_unreadable_file
@@ -52,6 +55,7 @@ module TestIRB
end
def test_code_around_binding_with_script_lines__
+ IRB.conf[:USE_COLORIZE] = false
with_script_lines do |script_lines|
Tempfile.create('irb') do |f|
code = "IRB::WorkSpace.new(binding)\n"
@@ -67,6 +71,8 @@ module TestIRB
EOS
end
end
+ ensure
+ IRB.conf.delete(:USE_COLORIZE)
end
def test_code_around_binding_on_irb