From 6604e1b7cd75bef7ed72db699d8f88a7fb56c330 Mon Sep 17 00:00:00 2001 From: hsbt Date: Sat, 23 Feb 2019 03:43:58 +0000 Subject: 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 --- test/json/json_addition_test.rb | 10 ++++++++++ test/json/test_helper.rb | 4 ---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'test/json') 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 diff --git a/test/json/test_helper.rb b/test/json/test_helper.rb index 7e99c29d0d..c5ec0fca7b 100644 --- a/test/json/test_helper.rb +++ b/test/json/test_helper.rb @@ -15,7 +15,3 @@ begin require 'byebug' rescue LoadError end -if ENV['START_SIMPLECOV'].to_i == 1 - require 'simplecov' - SimpleCov.start -end -- cgit v1.2.3