aboutsummaryrefslogtreecommitdiffstats
path: root/test/reline/config_test.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-21 09:13:49 +0000
committeraycabta <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-21 09:13:49 +0000
commit51cec00953ff8d7baa483d3846aa1dbdb89101aa (patch)
tree2900ea0ba7c09379990e9da2edda5d6ef8fa075c /test/reline/config_test.rb
parent683834eb72cfa77f4eac1c705327b522302b1721 (diff)
downloadruby-51cec00953ff8d7baa483d3846aa1dbdb89101aa.tar.gz
Revert "IRB is improved with Reline and RDoc"
This reverts commit 7f273ac6d0f05208b5b228da95205e20c0e8286c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/reline/config_test.rb')
-rw-r--r--test/reline/config_test.rb113
1 files changed, 0 insertions, 113 deletions
diff --git a/test/reline/config_test.rb b/test/reline/config_test.rb
deleted file mode 100644
index 34ee407498..0000000000
--- a/test/reline/config_test.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-require_relative 'helper'
-
-class Reline::Config::Test < Reline::TestCase
- def setup
- @pwd = Dir.pwd
- @tmpdir = File.join(Dir.tmpdir, "test_reline_config_#{$$}")
- Dir.mkdir(@tmpdir)
- Dir.chdir(@tmpdir)
- @config = Reline::Config.new
- end
-
- def teardown
- Dir.chdir(@pwd)
- FileUtils.rm_rf(@tmpdir)
- end
-
- def test_read_lines
- @config.read_lines(<<~LINES.split(/(?<=\n)/))
- set bell-style on
- LINES
-
- assert_equal :audible, @config.instance_variable_get(:@bell_style)
- end
-
- def test_bind_key
- key, func = @config.bind_key('"input"', '"abcde"')
-
- assert_equal 'input', key
- assert_equal 'abcde', func
- end
-
- def test_bind_key_with_macro
- key, func = @config.bind_key('"input"', 'abcde')
-
- assert_equal 'input', key
- assert_equal :abcde, func
- end
-
- def test_bind_key_with_escaped_chars
- assert_equal ['input', "\e \\ \" ' \a \b \d \f \n \r \t \v"], @config.bind_key('"input"', '"\\e \\\\ \\" \\\' \\a \\b \\d \\f \\n \\r \\t \\v"')
- end
-
- def test_bind_key_with_ctrl_chars
- assert_equal ['input', "\C-h\C-h"], @config.bind_key('"input"', '"\C-h\C-H"')
- end
-
- def test_bind_key_with_meta_chars
- assert_equal ['input', "\M-h\M-H".force_encoding('ASCII-8BIT')], @config.bind_key('"input"', '"\M-h\M-H"')
- end
-
- def test_bind_key_with_octal_number
- assert_equal ['input', "\1"], @config.bind_key('"input"', '"\1"')
- assert_equal ['input', "\12"], @config.bind_key('"input"', '"\12"')
- assert_equal ['input', "\123"], @config.bind_key('"input"', '"\123"')
- assert_equal ['input', ["\123", '4'].join], @config.bind_key('"input"', '"\1234"')
- end
-
- def test_bind_key_with_hexadecimal_number
- assert_equal ['input', "\x4"], @config.bind_key('"input"', '"\x4"')
- assert_equal ['input', "\x45"], @config.bind_key('"input"', '"\x45"')
- assert_equal ['input', ["\x45", '6'].join], @config.bind_key('"input"', '"\x456"')
- end
-
- def test_include
- File.open('included_partial', 'wt') do |f|
- f.write(<<~PARTIAL_LINES)
- set bell-style on
- PARTIAL_LINES
- end
- @config.read_lines(<<~LINES.split(/(?<=\n)/))
- $include included_partial
- LINES
-
- assert_equal :audible, @config.instance_variable_get(:@bell_style)
- end
-
- def test_if
- @config.read_lines(<<~LINES.split(/(?<=\n)/))
- $if Ruby
- set bell-style audible
- $else
- set bell-style visible
- $endif
- LINES
-
- assert_equal :audible, @config.instance_variable_get(:@bell_style)
- end
-
- def test_if_with_false
- @config.read_lines(<<~LINES.split(/(?<=\n)/))
- $if Python
- set bell-style audible
- $else
- set bell-style visible
- $endif
- LINES
-
- assert_equal :visible, @config.instance_variable_get(:@bell_style)
- end
-
- def test_if_with_indent
- @config.read_lines(<<~LINES.split(/(?<=\n)/))
- set bell-style none
- $if Ruby
- set bell-style audible
- $else
- set bell-style visible
- $endif
- LINES
-
- assert_equal :audible, @config.instance_variable_get(:@bell_style)
- end
-end