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

ruby-changes:27307

From: naruse <ko1@a...>
Date: Thu, 21 Feb 2013 17:31:59 +0900 (JST)
Subject: [ruby-changes:27307] naruse:r39359 (trunk): Add test for [Backport #7896]

naruse	2013-02-21 17:31:47 +0900 (Thu, 21 Feb 2013)

  New Revision: 39359

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39359

  Log:
    Add test for [Backport #7896] [ruby-core:52607]

  Modified files:
    trunk/ext/-test-/iter/break.c
    trunk/test/-ext-/iter/test_iter_break.rb

Index: ext/-test-/iter/break.c
===================================================================
--- ext/-test-/iter/break.c	(revision 39358)
+++ ext/-test-/iter/break.c	(revision 39359)
@@ -1,6 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ext/-test-/iter/break.c#L1
 #include <ruby.h>
 
 static VALUE
+iter_break(VALUE self)
+{
+    rb_iter_break();
+
+    UNREACHABLE;
+}
+
+static VALUE
 iter_break_value(VALUE self, VALUE val)
 {
     rb_iter_break_value(val);
@@ -12,5 +20,6 @@ void https://github.com/ruby/ruby/blob/trunk/ext/-test-/iter/break.c#L20
 Init_break(void)
 {
     VALUE breakable = rb_define_module_under(rb_define_module("Bug"), "Breakable");
-    rb_define_module_function(breakable, "iter_break", iter_break_value, 1);
+    rb_define_module_function(breakable, "iter_break", iter_break, 0);
+    rb_define_module_function(breakable, "iter_break_value", iter_break_value, 1);
 }
Index: test/-ext-/iter/test_iter_break.rb
===================================================================
--- test/-ext-/iter/test_iter_break.rb	(revision 39358)
+++ test/-ext-/iter/test_iter_break.rb	(revision 39359)
@@ -3,7 +3,10 @@ require '-test-/iter/break' https://github.com/ruby/ruby/blob/trunk/test/-ext-/iter/test_iter_break.rb#L3
 
 class TestIterBreak < Test::Unit::TestCase
   def test_iter_break
+    backport7896 = '[ruby-core:52607]'
+    assert_equal(nil, 1.times{Bug::Breakable.iter_break}, backport7896)
+
     feature5895 = '[ruby-dev:45132]'
-    assert_equal(42, 1.times{Bug::Breakable.iter_break(42)}, feature5895)
+    assert_equal(42, 1.times{Bug::Breakable.iter_break_value(42)}, feature5895)
   end
 end

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

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