mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/readline/readline.c (readline_s_get_special_prefixes): suppress
warning: unitinialized instance variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d998ba1c3c
commit
e47c4e38a8
3 changed files with 10 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Jun 19 11:52:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* ext/readline/readline.c (readline_s_get_special_prefixes): suppress
|
||||
warning: unitinialized instance variable.
|
||||
|
||||
Tue Jun 19 11:43:16 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* ext/readline/readline.c (readline_getc): fix editline compatibility
|
||||
|
|
|
@ -1248,6 +1248,7 @@ readline_s_get_special_prefixes(VALUE self)
|
|||
{
|
||||
VALUE str;
|
||||
rb_secure(4);
|
||||
if (rl_special_prefixes == NULL) return Qnil;
|
||||
str = rb_ivar_get(mReadline, id_special_prefixes);
|
||||
if (!NIL_P(str)) {
|
||||
str = rb_str_dup_frozen(str);
|
||||
|
|
|
@ -94,7 +94,7 @@ class Readline::TestHistory < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_get__out_of_range
|
||||
lines = push_history(5)
|
||||
push_history(5)
|
||||
invalid_indexes = [5, 6, 100, -6, -7, -100]
|
||||
invalid_indexes.each do |i|
|
||||
assert_raise(IndexError, "i=<#{i}>") do
|
||||
|
@ -113,7 +113,7 @@ class Readline::TestHistory < Test::Unit::TestCase
|
|||
|
||||
def test_set
|
||||
begin
|
||||
lines = push_history(5)
|
||||
push_history(5)
|
||||
5.times do |i|
|
||||
expected = "set: #{i}"
|
||||
HISTORY[i] = expected
|
||||
|
@ -128,7 +128,7 @@ class Readline::TestHistory < Test::Unit::TestCase
|
|||
HISTORY[0] = "set: 0"
|
||||
end
|
||||
|
||||
lines = push_history(5)
|
||||
push_history(5)
|
||||
invalid_indexes = [5, 6, 100, -6, -7, -100]
|
||||
invalid_indexes.each do |i|
|
||||
assert_raise(IndexError, NotImplementedError, "index=<#{i}>") do
|
||||
|
@ -277,7 +277,7 @@ class Readline::TestHistory < Test::Unit::TestCase
|
|||
HISTORY.delete_at(0)
|
||||
end
|
||||
|
||||
lines = push_history(5)
|
||||
push_history(5)
|
||||
invalid_indexes = [5, 6, 100, -6, -7, -100]
|
||||
invalid_indexes.each do |i|
|
||||
assert_raise(IndexError, NotImplementedError, "index=<#{i}>") do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue