mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
don't modify $/
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1ae2ac92d2
commit
23a4871368
1 changed files with 6 additions and 12 deletions
|
@ -35,18 +35,12 @@ if defined? Zlib
|
||||||
w << "abc"
|
w << "abc"
|
||||||
w.close
|
w.close
|
||||||
r = Zlib::GzipReader.new(StringIO.new(s))
|
r = Zlib::GzipReader.new(StringIO.new(s))
|
||||||
begin
|
r.ungetc ?\n
|
||||||
old_rs = $/
|
assert_equal("abc", r.gets(""))
|
||||||
$/ = ""
|
assert_nothing_raised {
|
||||||
r.ungetc ?\n
|
r.read
|
||||||
assert_equal("abc", r.gets)
|
r.close
|
||||||
assert_nothing_raised {
|
}
|
||||||
r.read
|
|
||||||
r.close
|
|
||||||
}
|
|
||||||
ensure
|
|
||||||
$/ = old_rs
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue