From b5cf3564471af6e11760bf381251f918cdcd7398 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 31 Aug 2022 13:20:40 +0900 Subject: 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. --- test/ruby/test_complex.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') 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 - + -- cgit v1.2.3