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>
|
Tue Jun 19 11:43:16 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* ext/readline/readline.c (readline_getc): fix editline compatibility
|
* ext/readline/readline.c (readline_getc): fix editline compatibility
|
||||||
|
|
|
@ -1248,6 +1248,7 @@ readline_s_get_special_prefixes(VALUE self)
|
||||||
{
|
{
|
||||||
VALUE str;
|
VALUE str;
|
||||||
rb_secure(4);
|
rb_secure(4);
|
||||||
|
if (rl_special_prefixes == NULL) return Qnil;
|
||||||
str = rb_ivar_get(mReadline, id_special_prefixes);
|
str = rb_ivar_get(mReadline, id_special_prefixes);
|
||||||
if (!NIL_P(str)) {
|
if (!NIL_P(str)) {
|
||||||
str = rb_str_dup_frozen(str);
|
str = rb_str_dup_frozen(str);
|
||||||
|
|
|
@ -94,7 +94,7 @@ class Readline::TestHistory < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_get__out_of_range
|
def test_get__out_of_range
|
||||||
lines = push_history(5)
|
push_history(5)
|
||||||
invalid_indexes = [5, 6, 100, -6, -7, -100]
|
invalid_indexes = [5, 6, 100, -6, -7, -100]
|
||||||
invalid_indexes.each do |i|
|
invalid_indexes.each do |i|
|
||||||
assert_raise(IndexError, "i=<#{i}>") do
|
assert_raise(IndexError, "i=<#{i}>") do
|
||||||
|
@ -113,7 +113,7 @@ class Readline::TestHistory < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_set
|
def test_set
|
||||||
begin
|
begin
|
||||||
lines = push_history(5)
|
push_history(5)
|
||||||
5.times do |i|
|
5.times do |i|
|
||||||
expected = "set: #{i}"
|
expected = "set: #{i}"
|
||||||
HISTORY[i] = expected
|
HISTORY[i] = expected
|
||||||
|
@ -128,7 +128,7 @@ class Readline::TestHistory < Test::Unit::TestCase
|
||||||
HISTORY[0] = "set: 0"
|
HISTORY[0] = "set: 0"
|
||||||
end
|
end
|
||||||
|
|
||||||
lines = push_history(5)
|
push_history(5)
|
||||||
invalid_indexes = [5, 6, 100, -6, -7, -100]
|
invalid_indexes = [5, 6, 100, -6, -7, -100]
|
||||||
invalid_indexes.each do |i|
|
invalid_indexes.each do |i|
|
||||||
assert_raise(IndexError, NotImplementedError, "index=<#{i}>") do
|
assert_raise(IndexError, NotImplementedError, "index=<#{i}>") do
|
||||||
|
@ -277,7 +277,7 @@ class Readline::TestHistory < Test::Unit::TestCase
|
||||||
HISTORY.delete_at(0)
|
HISTORY.delete_at(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
lines = push_history(5)
|
push_history(5)
|
||||||
invalid_indexes = [5, 6, 100, -6, -7, -100]
|
invalid_indexes = [5, 6, 100, -6, -7, -100]
|
||||||
invalid_indexes.each do |i|
|
invalid_indexes.each do |i|
|
||||||
assert_raise(IndexError, NotImplementedError, "index=<#{i}>") do
|
assert_raise(IndexError, NotImplementedError, "index=<#{i}>") do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue