@@ -133,23 +133,21 @@ def test_parse_string_mixed_unicode
133133 assert_equal ( [ "éé" ] , JSON . parse ( "[\" \\ u00e9é\" ]" ) )
134134 end
135135
136- if Array . method_defined? ( :permutation )
137- def test_parse_more_complex_arrays
138- a = [ nil , false , true , "foßbar" , [ "n€st€d" , true ] , { "nested" => true , "n€ßt€ð2" => { } } ]
139- a . permutation . each do |perm |
140- json = pretty_generate ( perm )
141- assert_equal perm , parse ( json )
142- end
136+ def test_parse_more_complex_arrays
137+ a = [ nil , false , true , "foßbar" , [ "n€st€d" , true ] , { "nested" => true , "n€ßt€ð2" => { } } ]
138+ a . permutation . each do |perm |
139+ json = pretty_generate ( perm )
140+ assert_equal perm , parse ( json )
143141 end
142+ end
144143
145- def test_parse_complex_objects
146- a = [ nil , false , true , "foßbar" , [ "n€st€d" , true ] , { "nested" => true , "n€ßt€ð2" => { } } ]
147- a . permutation . each do |perm |
148- s = "a"
149- orig_obj = perm . inject ( { } ) { |h , x | h [ s . dup ] = x ; s = s . succ ; h }
150- json = pretty_generate ( orig_obj )
151- assert_equal orig_obj , parse ( json )
152- end
144+ def test_parse_complex_objects
145+ a = [ nil , false , true , "foßbar" , [ "n€st€d" , true ] , { "nested" => true , "n€ßt€ð2" => { } } ]
146+ a . permutation . each do |perm |
147+ s = "a"
148+ orig_obj = perm . inject ( { } ) { |h , x | h [ s . dup ] = x ; s = s . succ ; h }
149+ json = pretty_generate ( orig_obj )
150+ assert_equal orig_obj , parse ( json )
153151 end
154152 end
155153
0 commit comments