From 12d3325346842b309e58e6eabd11e34ec5a8c615 Mon Sep 17 00:00:00 2001 From: ocean Date: Tue, 10 Jan 2006 03:50:28 +0000 Subject: * lib/yaml/rubytypes.rb (Fixnum): Bignum could not be loaded in ruby 1.8.3/1.8.4. [ruby-core:6115] * lib/yaml/rubytypes.rb (Numeric): Subclass of Numeric could not be dumped properly. [ruby-core:7047] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/yaml/test_yaml.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/yaml') diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb index fe506675f3..78a0877300 100644 --- a/test/yaml/test_yaml.rb +++ b/test/yaml/test_yaml.rb @@ -1236,6 +1236,23 @@ EOY assert_cycle(:"^foo") end + # + # Test Numeric cycle + # + class NumericTest < Numeric + def initialize(value) + @value = value + end + def ==(other) + @value == other.instance_eval{ @value } + end + end + def test_numeric_cycle + assert_cycle(1) # Fixnum + assert_cycle(111111111111111111111111111111111) # Bignum + assert_cycle(NumericTest.new(3)) # Subclass of Numeric + end + end if $0 == __FILE__ -- cgit v1.2.3