summaryrefslogtreecommitdiff
path: root/test/yaml
diff options
context:
space:
mode:
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 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__