ruby-changes:63387
From: Chris <ko1@a...>
Date: Tue, 20 Oct 2020 21:52:27 +0900 (JST)
Subject: [ruby-changes:63387] 451836f582 (master): Fix an issue with generate_pretty and empty objects in the Ruby and Java implementations
https://git.ruby-lang.org/ruby.git/commit/?id=451836f582 From 451836f5824fdf3c457ab8a5fd91d94cea91862e Mon Sep 17 00:00:00 2001 From: Chris Seaton <chris.seaton@s...> Date: Wed, 7 Oct 2020 03:13:48 +0100 Subject: Fix an issue with generate_pretty and empty objects in the Ruby and Java implementations diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb index 77b539d..2ecdc97 100644 --- a/test/json/json_generator_test.rb +++ b/test/json/json_generator_test.rb @@ -92,6 +92,11 @@ EOT https://github.com/ruby/ruby/blob/trunk/test/json/json_generator_test.rb#L92 end def test_generate_pretty + json = pretty_generate({}) + assert_equal(<<'EOT'.chomp, json) +{ +} +EOT json = pretty_generate(@hash) # hashes aren't (insertion) ordered on every ruby implementation # assert_equal(@json3, json) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/