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

ruby-changes:66155

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Wed, 12 May 2021 10:31:08 +0900 (JST)
Subject: [ruby-changes:66155] 6911b4bc82 (master): test_cdhash: refactor change class

https://git.ruby-lang.org/ruby.git/commit/?id=6911b4bc82

From 6911b4bc82889860ff7da4ecf975504cdc3e5314 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Mon, 10 May 2021 10:02:12 +0900
Subject: test_cdhash: refactor change class

It is now strange to test Complex in a class named Rational_Test.
---
 test/ruby/test_rational.rb | 15 ---------------
 test/ruby/test_syntax.rb   | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index 27d0527..fe9de64 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -830,21 +830,6 @@ class Rational_Test < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rational.rb#L830
     assert_raise(ZeroDivisionError) {Rational("1/0")}
   end
 
-  def test_cdhash
-    assert_separately([], <<-RUBY)
-      n = case 1 when 2r then false else true end
-      assert_equal(n, true, '[ruby-core:103759] [Bug #17854]')
-    RUBY
-    assert_separately([], <<-RUBY)
-      n = case 3/2r when 1.5r then true else false end
-      assert_equal(n, true, '[ruby-core:103759] [Bug #17854]')
-    RUBY
-    assert_separately([], <<-RUBY)
-      n = case 1i when 1i then true else false end
-      assert_equal(n, true, '[ruby-core:103759] [Bug #17854]')
-    RUBY
-  end
-
   def test_Rational_with_invalid_exception
     assert_raise(ArgumentError) {
       Rational("1/1", exception: 1)
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index e289eea..a0cdb5b 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -1730,6 +1730,21 @@ eom https://github.com/ruby/ruby/blob/trunk/test/ruby/test_syntax.rb#L1730
     assert_equal [[4, 1, 5, 2, 3], {a: 1}], obj.foo(4, 5, 2, 3, a: 1){|args, kws| [args, kws]}
   end
 
+  def test_cdhash
+    assert_separately([], <<-RUBY)
+      n = case 1 when 2r then false else true end
+      assert_equal(n, true, '[ruby-core:103759] [Bug #17854]')
+    RUBY
+    assert_separately([], <<-RUBY)
+      n = case 3/2r when 1.5r then true else false end
+      assert_equal(n, true, '[ruby-core:103759] [Bug #17854]')
+    RUBY
+    assert_separately([], <<-RUBY)
+      n = case 1i when 1i then true else false end
+      assert_equal(n, true, '[ruby-core:103759] [Bug #17854]')
+    RUBY
+  end
+
   private
 
   def not_label(x) @result = x; @not_label ||= nil end
-- 
cgit v1.1


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

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