summaryrefslogtreecommitdiffstats
path: root/test/yaml
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-01-10 03:50:28 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-01-10 03:50:28 +0000
commit6b3533ed4c70cdd11bd8f19234cf29e8eb84343a (patch)
tree12050e433bfd36426d980361151ced0b65041be4 /test/yaml
parent286e957c3b0aa72ad2ce6df2f6ab03acb051d530 (diff)
downloadruby-6b3533ed4c70cdd11bd8f19234cf29e8eb84343a.tar.gz
ruby-6b3533ed4c70cdd11bd8f19234cf29e8eb84343a.tar.xz
ruby-6b3533ed4c70cdd11bd8f19234cf29e8eb84343a.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@9816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/yaml')
-rw-r--r--test/yaml/test_yaml.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb
index fe506675f..78a087730 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__