summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-08-31 13:20:40 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-09-02 14:33:23 +0900
commitb5cf3564471af6e11760bf381251f918cdcd7398 (patch)
treeb16c9e26caa7a1e3b79f4366083132dd334805db /test
parent9212d963070612e669c40e5fde7954f19d648002 (diff)
Consider Complex from Complex cases
The assertions that "an argument of a Complex constructor must not be a Complex" may not hold for some Numeric objects.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6317
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_complex.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb
index 13511fd4cf..17b5f64db2 100644
--- a/test/ruby/test_complex.rb
+++ b/test/ruby/test_complex.rb
@@ -567,7 +567,7 @@ class Complex_Test < Test::Unit::TestCase
assert_raise_with_message(TypeError, /C\u{1f5ff}/) { Complex(1).coerce(obj) }
end
- class ObjectX
+ class ObjectX < Numeric
def initialize(real = true, n = 1) @n = n; @real = real; end
def +(x) Rational(@n) end
alias - +