summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2011-08-25 08:52:47 +0200
committerFlorian Frank <flori@ping.de>2011-08-25 08:52:47 +0200
commitd98acaecd9391e21e2fe1a0771ab8b93b3b4bdf1 (patch)
tree17efd9856023fc39e2ddeb31500be797886cfccb /tests
parent9320a2a18a4d09f8e8a83129db793057968928b1 (diff)
downloadjson-d98acaecd9391e21e2fe1a0771ab8b93b3b4bdf1.tar.gz
Add (de-)serialisation methods f. Complex/Rational
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_json_addition.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_json_addition.rb b/tests/test_json_addition.rb
index a8181e8..f28f228 100755
--- a/tests/test_json_addition.rb
+++ b/tests/test_json_addition.rb
@@ -164,4 +164,9 @@ class TC_JSONAddition < Test::Unit::TestCase
d = DateTime.civil(2008, 6, 17, 11, 48, 32, Rational(12,24))
assert_equal d, JSON.parse(d.to_json)
end
+
+ def test_rational_complex
+ assert_equal Rational(2, 9), JSON(JSON(Rational(2, 9)))
+ assert_equal Complex(2, 9), JSON(JSON(Complex(2, 9)))
+ end
end