From: Florian Frank Date: 2007-06-07T03:51:07+09:00 Subject: [ruby-dev:30907] Re: JSON ライブラリを取り込みました Hi, SASADA Koichi wrote: >> Finished in 0.313759 seconds. >> >> 1) Failure: >> test_unparse(TC_JSONGenerate) [/home/ko1/ruby/trunk/test/json/test_json_generate.rb:43]: >> <"{\"a\":2,\"b\":3.141,\"c\":\"c\",\"d\":[1,\"b\",3.14],\"e\":{\"foo\":\"bar\"},\"g\":\"\\\"\\u0000\\u001f\",\"h\":1000.0,\"i\":0.001}"> expected but was >> <"{\"a\":2,\"h\":1000.0,\"g\":\"\\\"\\u0000\\u001f\",\"b\":3.141,\"d\":[1,\"b\",3.14],\"c\":\"c\",\"i\":0.001,\"e\":{\"foo\":\"bar\"}}">. >> >> 2) Failure: >> test_unparse_pretty(TC_JSONGenerate) [/home/ko1/ruby/trunk/test/json/test_json_generate.rb:54]: >> <"{\n \"a\": 2,\n \"b\": 3.141,\n \"c\": \"c\",\n \"d\": [\n 1,\n \"b\",\n 3.14\n ],\n \"e\": {\n \"foo\": \"bar\"\n },\n \"g\": \"\\\"\\u0000\\u001f\",\n \"h\": 1000.0,\n \"i\": 0.001\n}"> expected but was >> <"{\n \"a\": 2,\n \"h\": 1000.0,\n \"g\": \"\\\"\\u0000\\u001f\",\n \"b\": 3.141,\n \"d\": [\n 1,\n \"b\",\n 3.14\n ],\n \"c\": \"c\",\n \"i\": 0.001,\n \"e\": {\n \"foo\": \"bar\"\n }\n}">. >> >> 22 tests, 327 assertions, 2 failures, 0 errors >> make: *** [test-all] Error 1 Sorry, not much in Japanese from me, but can you try this patch? Index: tests/test_json_generate.rb =================================================================== --- tests/test_json_generate.rb (.../tags/v1_1_0) (revision 133) +++ tests/test_json_generate.rb (.../trunk) (revision 133) @@ -40,7 +40,7 @@ def test_unparse json = unparse(@hash) - assert_equal(@json2, json) + assert_equal(JSON.parse(@json2), JSON.parse(json)) parsed_json = parse(json) assert_equal(@hash, parsed_json) json = generate({1=>2}) @@ -51,7 +51,7 @@ def test_unparse_pretty json = pretty_unparse(@hash) - assert_equal(@json3, json) + assert_equal(JSON.parse(@json3), JSON.parse(json)) parsed_json = parse(json) assert_equal(@hash, parsed_json) json = pretty_generate({1=>2}) -- Florian Frank