[前][次][番号順一覧][スレッド一覧]

ruby-changes:41852

From: usa <ko1@a...>
Date: Thu, 25 Feb 2016 18:16:15 +0900 (JST)
Subject: [ruby-changes:41852] usa:r53926 (ruby_2_1): merge revision(s) 53329: [Backport #11885]

usa	2016-02-25 18:16:54 +0900 (Thu, 25 Feb 2016)

  New Revision: 53926

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53926

  Log:
    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]

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/io.c
    branches/ruby_2_1/test/ruby/test_io.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 53925)
+++ ruby_2_1/ChangeLog	(revision 53926)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Thu Feb 25 18:12:00 2016  Eric Wong  <e@8...>
+
+	* io.c (io_getpartial): remove unused kwarg from template
+	* test/ruby/test_io.rb (test_readpartial_bad_args): new
+	  [Bug #11885]
+
 Thu Feb 25 17:51:35 2016  Tadashi Saito  <tadashi_saito@d...>
 
 	* compile.c, cont.c, doc, man: fix common misspelling.
Index: ruby_2_1/io.c
===================================================================
--- ruby_2_1/io.c	(revision 53925)
+++ ruby_2_1/io.c	(revision 53926)
@@ -2419,7 +2419,7 @@ io_getpartial(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/ruby_2_1/io.c#L2419
     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);
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 53925)
+++ ruby_2_1/version.h	(revision 53926)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.9"
 #define RUBY_RELEASE_DATE "2016-02-25"
-#define RUBY_PATCHLEVEL 447
+#define RUBY_PATCHLEVEL 448
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 2
Index: ruby_2_1/test/ruby/test_io.rb
===================================================================
--- ruby_2_1/test/ruby/test_io.rb	(revision 53925)
+++ ruby_2_1/test/ruby/test_io.rb	(revision 53926)
@@ -2997,6 +2997,17 @@ End https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_io.rb#L2997
     t.kill
   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]'
 

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r53329


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]