зеркало из https://github.com/github/ruby.git
test_flip.rb: r56316
* test/ruby/test_flip.rb (test_input_line_number_range): test for r56316. [ruby-core:78162] [Bug #12947] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
558c362f60
Коммит
13969a2b5d
|
@ -50,4 +50,25 @@ class TestFlip < Test::Unit::TestCase
|
|||
assert_equal(expected, v1, mesg)
|
||||
assert_equal(expected, v2, mesg)
|
||||
end
|
||||
|
||||
def test_input_line_number_range
|
||||
bug12947 = '[ruby-core:78162] [Bug #12947]'
|
||||
ary = b1 = b2 = nil
|
||||
EnvUtil.suppress_warning do
|
||||
b1 = eval("proc {|i| i if 2..4}")
|
||||
b2 = eval("proc {|i| if 2..4; i; end}")
|
||||
end
|
||||
IO.pipe {|r, w|
|
||||
th = Thread.start {(1..5).each {|i| w.puts i};w.close}
|
||||
ary = r.map {|i| b1.call(i.chomp)}
|
||||
th.join
|
||||
}
|
||||
assert_equal([nil, "2", "3", "4", nil], ary, bug12947)
|
||||
IO.pipe {|r, w|
|
||||
th = Thread.start {(1..5).each {|i| w.puts i};w.close}
|
||||
ary = r.map {|i| b2.call(i.chomp)}
|
||||
th.join
|
||||
}
|
||||
assert_equal([nil, "2", "3", "4", nil], ary, bug12947)
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче