* 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:
kouji 2008-12-21 04:51:43 +00:00
Родитель 5ad1f1d3cd
Коммит 67cd02b40c
2 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -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>
* 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
begin
enc = Encoding.default_internal || Encoding.find("locale")
enc = get_default_internal_encoding
data_expected = [
["x", "x"],
["xyx", "x"],
@ -200,11 +200,14 @@ class TestReadline < Test::Unit::TestCase
method_names.each do |method_name|
begin
begin
enc = get_default_internal_encoding
saved = Readline.send(method_name.to_sym)
expecteds = [" ", " .,|\t", ""]
expecteds.each do |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
ensure
Readline.send((method_name + "=").to_sym, saved) if saved
@ -236,4 +239,8 @@ class TestReadline < Test::Unit::TestCase
}
}
end
def get_default_internal_encoding
return Encoding.default_internal || Encoding.find("locale")
end
end if defined?(::Readline)