diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-17 21:36:17 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-17 21:36:17 +0000 |
commit | 4cb618e7aacf84cf7c241ee0513bbb37e1068c9d (patch) | |
tree | 9022b6c440e8dcaf11d9f0eb04125ef84fb58677 /spec/ruby | |
parent | b3b786c580995b31dcc0259890cefdb1385998c6 (diff) |
merge revision(s) 66760,66761,66824: [Backport #15460]
Follow behaviour of IO#ungetbyte
see r65802 and [Bug #14359]
* expand tabs.
setbyte / ungetbyte allow out-of-range integers
* string.c: String#setbyte to accept arbitrary integers [Bug #15460]
* io.c: ditto for IO#ungetbyte
* ext/strringio/stringio.c: ditto for StringIO#ungetbyte
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@66845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/io/ungetbyte_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/ruby/core/io/ungetbyte_spec.rb b/spec/ruby/core/io/ungetbyte_spec.rb index 2639d24c45..2e51fb0298 100644 --- a/spec/ruby/core/io/ungetbyte_spec.rb +++ b/spec/ruby/core/io/ungetbyte_spec.rb @@ -49,7 +49,7 @@ describe "IO#ungetbyte" do end end - ruby_version_is '2.6' do + ruby_version_is '2.6'...'2.7' do it "is an RangeError if the integer is not in 8bit" do for i in [4095, 0x4f7574206f6620636861722072616e6765] do lambda { @io.ungetbyte(i) }.should raise_error(RangeError) @@ -57,6 +57,14 @@ describe "IO#ungetbyte" do end end + ruby_version_is '2.7' do + it "never raises RangeError" do + for i in [4095, 0x4f7574206f6620636861722072616e6765] do + lambda { @io.ungetbyte(i) }.should_not raise_error + end + end + end + it "raises an IOError if the IO is closed" do @io.close lambda { @io.ungetbyte(42) }.should raise_error(IOError) |