Skip to content

Commit 3e2ec61

Browse files
committed
Clarify why Oj.strict_load is used
1 parent 9b9c10e commit 3e2ec61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/test_urlpattern.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def test_that_it_has_a_version_number
1818
URLPATTERNTESTDATA = begin
1919
UNDERSCORE = { baseURL: :base_url, ignoreCase: :ignore_case }.freeze
2020

21-
# Use `Oj.strict_load` with `allow_invalid_unicode` to work around `JSON::ParserError` (incomplete surrogate pair).
21+
# `JSON.parse` raises `JSON::ParserError` (incomplete surrogate pair) for some test data.
22+
# To work around this, use `Oj.strict_load` with `allow_invalid_unicode`.
2223
Oj.strict_load(File.read(
2324
File.join(__dir__, "fixtures", "urlpatterntestdata.json"), encoding: Encoding::UTF_8
2425
), { allow_invalid_unicode: true, symbol_keys: true }).map do |entry|

0 commit comments

Comments
 (0)