Copy IO#timeout
on IO#dup
. (#6546)
This commit is contained in:
parent
7b7e5153e8
commit
d416205341
Notes:
git
2022-10-14 21:46:20 +09:00
Merged-By: ioquatix <samuel@codeotaku.com>
1
io.c
1
io.c
@ -8407,6 +8407,7 @@ rb_io_init_copy(VALUE dest, VALUE io)
|
|||||||
fptr->encs = orig->encs;
|
fptr->encs = orig->encs;
|
||||||
fptr->pid = orig->pid;
|
fptr->pid = orig->pid;
|
||||||
fptr->lineno = orig->lineno;
|
fptr->lineno = orig->lineno;
|
||||||
|
fptr->timeout = orig->timeout;
|
||||||
if (!NIL_P(orig->pathv)) fptr->pathv = orig->pathv;
|
if (!NIL_P(orig->pathv)) fptr->pathv = orig->pathv;
|
||||||
fptr_copy_finalizer(fptr, orig);
|
fptr_copy_finalizer(fptr, orig);
|
||||||
|
|
||||||
|
@ -1441,6 +1441,14 @@ class TestIO < Test::Unit::TestCase
|
|||||||
End
|
End
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_dup_timeout
|
||||||
|
with_pipe do |r, w|
|
||||||
|
r.timeout = 0.1
|
||||||
|
r2 = r.dup
|
||||||
|
assert_equal(0.1, r2.timeout)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_inspect
|
def test_inspect
|
||||||
with_pipe do |r, w|
|
with_pipe do |r, w|
|
||||||
assert_match(/^#<IO:fd \d+>$/, r.inspect)
|
assert_match(/^#<IO:fd \d+>$/, r.inspect)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user