diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-29 04:56:07 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-29 04:56:07 +0000 |
commit | e6489da9e3ddf6b109aa3db22be414c84ec4afab (patch) | |
tree | ea2ead40534c420d17424946d85bad59354d84af | |
parent | 6b73bb455ecc89dc6134f5234a3a3a3822b5c3e6 (diff) |
merge revision(s) 53329: [Backport #11885]
* io.c (io_getpartial): remove unused kwarg from template
* test/ruby/test_io.rb (test_readpartial_bad_args): new
[Bug #11885]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | io.c | 2 | ||||
-rw-r--r-- | test/ruby/test_io.rb | 11 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 19 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Tue Mar 29 13:50:30 2016 Eric Wong <e@80x24.org> + + * io.c (io_getpartial): remove unused kwarg from template + * test/ruby/test_io.rb (test_readpartial_bad_args): new + [Bug #11885] + Tue Mar 29 13:41:03 2016 Tadashi Saito <tadashi_saito@dwango.co.jp> * compile.c, cont.c, doc, man: fix common misspelling. @@ -2506,7 +2506,7 @@ io_getpartial(int argc, VALUE *argv, VALUE io, VALUE opts, int nonblock) long n, len; struct read_internal_arg arg; - rb_scan_args(argc, argv, "11:", &length, &str, NULL); + rb_scan_args(argc, argv, "11", &length, &str); if ((len = NUM2LONG(length)) < 0) { rb_raise(rb_eArgError, "negative length %ld given", len); diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 766804eb2e..2b79acea09 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -3186,6 +3186,17 @@ End } end + def test_readpartial_bad_args + IO.pipe do |r, w| + w.write '.' + buf = String.new + assert_raise(ArgumentError) { r.readpartial(1, buf, exception: false) } + assert_raise(TypeError) { r.readpartial(1, exception: false) } + assert_equal [[r],[],[]], IO.select([r], nil, nil, 1) + assert_equal '.', r.readpartial(1) + end + end + def test_sysread_unlocktmp_ensure bug8669 = '[ruby-core:56121] [Bug #8669]' @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.3.0" #define RUBY_RELEASE_DATE "2016-03-29" -#define RUBY_PATCHLEVEL 10 +#define RUBY_PATCHLEVEL 11 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 3 |