|
1 | 1 | require 'test_helper'
|
2 | 2 |
|
3 | 3 | class JSONSchemaTestSuiteTest < Minitest::Test
|
4 |
| - # https://github.com/flori/json/pull/483 |
5 |
| - INCOMPATIBLE_FILES = if RUBY_ENGINE == 'truffleruby' && Gem::Version.new(JSON::VERSION) < '2.6.3' |
6 |
| - # :nocov: |
7 |
| - Set[ |
8 |
| - 'JSON-Schema-Test-Suite/tests/draft2020-12/optional/ecmascript-regex.json', |
9 |
| - 'JSON-Schema-Test-Suite/tests/draft2019-09/optional/ecmascript-regex.json', |
10 |
| - 'JSON-Schema-Test-Suite/tests/draft7/optional/ecmascript-regex.json', |
11 |
| - 'JSON-Schema-Test-Suite/tests/draft6/optional/ecmascript-regex.json', |
12 |
| - 'JSON-Schema-Test-Suite/tests/draft4/optional/ecmascript-regex.json' |
13 |
| - ] |
14 |
| - # :nocov: |
15 |
| - else |
16 |
| - Set[] |
17 |
| - end |
18 |
| - |
19 | 4 | OUTPUT_DRAFTS = {
|
20 | 5 | 'draft2020-12' => JSONSchemer.draft202012,
|
21 | 6 | 'draft2019-09' => JSONSchemer.draft201909
|
@@ -122,20 +107,14 @@ def test_json_schema_test_suite
|
122 | 107 | # :nocov:
|
123 | 108 | end
|
124 | 109 | end
|
125 |
| - rescue JSON::ParserError => e |
126 |
| - # :nocov: |
127 |
| - raise unless Encoding::CompatibilityError === e.cause && INCOMPATIBLE_FILES.include?(file) |
128 |
| - # :nocov: |
129 | 110 | end
|
130 | 111 |
|
131 | 112 | fixture = Pathname.new(__dir__).join('fixtures', "#{draft}.json")
|
132 | 113 | # :nocov:
|
133 | 114 | if ENV['WRITE_FIXTURES'] == 'true'
|
134 | 115 | fixture.write("#{JSON.pretty_generate(output)}\n")
|
135 | 116 | else
|
136 |
| - fixture_json = JSON.parse(fixture.read) |
137 |
| - INCOMPATIBLE_FILES.each { |file| fixture_json.delete(file) } |
138 |
| - assert_equal(output, fixture_json) |
| 117 | + assert_equal(output, JSON.parse(fixture.read)) |
139 | 118 | end
|
140 | 119 | # :nocov:
|
141 | 120 | end
|
|
0 commit comments