summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2016-02-25 00:45:21 +0100
committerFlorian Frank <flori@ping.de>2016-02-25 00:45:42 +0100
commited95eebd5b8dd21eab95f86c1bba1285ebf0a414 (patch)
treeafc1c44fc609e6f157ab810d8fa092cbe2f37e24 /tests
parent8d08bb3db9e9e04a5a500c34e44cce4bb04b2ad8 (diff)
downloadjson-ed95eebd5b8dd21eab95f86c1bba1285ebf0a414.tar.gz
Remove permutation dependency
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_json.rb34
1 files changed, 0 insertions, 34 deletions
diff --git a/tests/test_json.rb b/tests/test_json.rb
index 7957773..98f7a49 100755
--- a/tests/test_json.rb
+++ b/tests/test_json.rb
@@ -7,20 +7,6 @@ require 'stringio'
require 'tempfile'
require 'ostruct'
-unless Array.method_defined?(:permutation)
- begin
- require 'enumerator'
- require 'permutation'
- class Array
- def permutation
- Permutation.for(self).to_enum.map { |x| x.project }
- end
- end
- rescue LoadError
- warn "Skipping permutation tests."
- end
-end
-
class TestJSON < Test::Unit::TestCase
include JSON
@@ -146,26 +132,6 @@ class TestJSON < Test::Unit::TestCase
assert_raise(JSON::ParserError) { JSON.parse('[ 1, ]', :quirks_mode => true) }
end
- if Array.method_defined?(:permutation)
- def test_parse_more_complex_arrays
- a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]
- a.permutation.each do |perm|
- json = pretty_generate(perm)
- assert_equal perm, parse(json)
- end
- end
-
- def test_parse_complex_objects
- a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]
- a.permutation.each do |perm|
- s = "a"
- orig_obj = perm.inject({}) { |h, x| h[s.dup] = x; s = s.succ; h }
- json = pretty_generate(orig_obj)
- assert_equal orig_obj, parse(json)
- end
- end
- end
-
def test_parse_arrays
assert_equal([1,2,3], parse('[1,2,3]'))
assert_equal([1.2,2,3], parse('[1.2,2,3]'))