diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-23 03:43:58 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-23 03:43:58 +0000 |
commit | 6604e1b7cd75bef7ed72db699d8f88a7fb56c330 (patch) | |
tree | b92ad3bacaa1f7f54152af362decaadc30466617 /test/json/json_addition_test.rb | |
parent | f22ffd83e92a214a697e93fe715d29cbfa52084d (diff) |
Merge json-2.2.0 from flori/json.
https://github.com/flori/json/releases/tag/v2.2.0
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/json/json_addition_test.rb')
-rw-r--r-- | test/json/json_addition_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/json/json_addition_test.rb b/test/json/json_addition_test.rb index a028e0f08a..61625f89e2 100644 --- a/test/json/json_addition_test.rb +++ b/test/json/json_addition_test.rb @@ -5,6 +5,7 @@ require 'json/add/complex' require 'json/add/rational' require 'json/add/bigdecimal' require 'json/add/ostruct' +require 'json/add/set' require 'date' class JSONAdditionTest < Test::Unit::TestCase @@ -190,4 +191,13 @@ class JSONAdditionTest < Test::Unit::TestCase o.foo = { 'bar' => true } assert_equal o, parse(JSON(o), :create_additions => true) end + + def test_set + s = Set.new([:a, :b, :c, :a]) + assert_equal s, JSON.parse(JSON(s), :create_additions => true) + ss = SortedSet.new([:d, :b, :a, :c]) + ss_again = JSON.parse(JSON(ss), :create_additions => true) + assert_kind_of ss.class, ss_again + assert_equal ss, ss_again + end end |