diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-08-31 13:20:40 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-09-02 14:33:23 +0900 |
commit | b5cf3564471af6e11760bf381251f918cdcd7398 (patch) | |
tree | b16c9e26caa7a1e3b79f4366083132dd334805db /test/ruby | |
parent | 9212d963070612e669c40e5fde7954f19d648002 (diff) | |
download | ruby-b5cf3564471af6e11760bf381251f918cdcd7398.tar.gz |
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.
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_complex.rb | 2 |
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 - + |