summaryrefslogtreecommitdiff
path: root/test/json
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-26 12:30:07 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-26 12:30:07 +0000
commit2b3f026b8abb2cf7061e0978fb3eca4c3e0cbeaf (patch)
tree4625fb932d2381b875aed35827a8dae8d5647ccd /test/json
parent945faf92e69d173ccea393caefaf8c222a251bb8 (diff)
* test/json/test_json.rb: remove dependency on permutation gem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/json')
-rwxr-xr-xtest/json/test_json.rb34
1 files changed, 13 insertions, 21 deletions
diff --git a/test/json/test_json.rb b/test/json/test_json.rb
index 8cb2267..02da6d4 100755
--- a/test/json/test_json.rb
+++ b/test/json/test_json.rb
@@ -90,30 +90,22 @@ class TC_JSON < Test::Unit::TestCase
assert_equal({ "a" => 0.23 }, parse(' { "a" : 0.23 } '))
end
- begin
- require 'permutation'
- def test_parse_more_complex_arrays
- a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]
- perms = Permutation.for a
- perms.each do |perm|
- orig_ary = perm.project
- json = pretty_generate(orig_ary)
- assert_equal orig_ary, parse(json)
- end
+ def test_parse_more_complex_arrays
+ a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]
+ a.permutation do |orig_ary|
+ json = pretty_generate(orig_ary)
+ assert_equal orig_ary, parse(json)
end
+ end
- def test_parse_complex_objects
- a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]
- perms = Permutation.for a
- perms.each do |perm|
- s = "a"
- orig_obj = perm.project.inject({}) { |h, x| h[s.dup] = x; s = s.succ; h }
- json = pretty_generate(orig_obj)
- assert_equal orig_obj, parse(json)
- end
+ def test_parse_complex_objects
+ a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]
+ a.permutation do |orig_ary|
+ s = "a"
+ orig_obj = orig_ary.inject({}) { |h, x| h[s.dup] = x; s = s.succ; h }
+ json = pretty_generate(orig_obj)
+ assert_equal orig_obj, parse(json)
end
- rescue LoadError
- warn "Skipping permutation tests."
end
def test_parse_arrays