mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/readline/test_readline.rb
(TestReadline#test_some_characters_methods): checked encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5ad1f1d3cd
commit
67cd02b40c
2 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sun Dec 21 13:50:37 2008 TAKAO Kouji <kouji@takao7.net>
|
||||||
|
|
||||||
|
* test/readline/test_readline.rb
|
||||||
|
(TestReadline#test_some_characters_methods): checked encoding.
|
||||||
|
|
||||||
Sun Dec 21 12:23:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Dec 21 12:23:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/optparse.rb (SPLAT_PROC): fix for regexp. [ruby-dev:37514]
|
* lib/optparse.rb (SPLAT_PROC): fix for regexp. [ruby-dev:37514]
|
||||||
|
|
|
@ -166,7 +166,7 @@ class TestReadline < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_completion_append_character
|
def test_completion_append_character
|
||||||
begin
|
begin
|
||||||
enc = Encoding.default_internal || Encoding.find("locale")
|
enc = get_default_internal_encoding
|
||||||
data_expected = [
|
data_expected = [
|
||||||
["x", "x"],
|
["x", "x"],
|
||||||
["xyx", "x"],
|
["xyx", "x"],
|
||||||
|
@ -200,11 +200,14 @@ class TestReadline < Test::Unit::TestCase
|
||||||
method_names.each do |method_name|
|
method_names.each do |method_name|
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
|
enc = get_default_internal_encoding
|
||||||
saved = Readline.send(method_name.to_sym)
|
saved = Readline.send(method_name.to_sym)
|
||||||
expecteds = [" ", " .,|\t", ""]
|
expecteds = [" ", " .,|\t", ""]
|
||||||
expecteds.each do |e|
|
expecteds.each do |e|
|
||||||
Readline.send((method_name + "=").to_sym, e)
|
Readline.send((method_name + "=").to_sym, e)
|
||||||
assert_equal(e, Readline.send(method_name.to_sym))
|
res = Readline.send(method_name.to_sym)
|
||||||
|
assert_equal(e, res)
|
||||||
|
assert_equal(enc, res.encoding)
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
Readline.send((method_name + "=").to_sym, saved) if saved
|
Readline.send((method_name + "=").to_sym, saved) if saved
|
||||||
|
@ -236,4 +239,8 @@ class TestReadline < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_default_internal_encoding
|
||||||
|
return Encoding.default_internal || Encoding.find("locale")
|
||||||
|
end
|
||||||
end if defined?(::Readline)
|
end if defined?(::Readline)
|
||||||
|
|
Loading…
Add table
Reference in a new issue