@@ -58,29 +58,29 @@ def test_literals
5858 assert_format ( "1\n " )
5959 end
6060
61- Dir [ "test/JSONTestSuite/test_parsing/y_*.json" ] . each do |filepath |
62- define_method ( :"test_#{ filepath } " ) do
63- parse ( JSON . read ( filepath ) )
64- end
61+ pattern = "JSONTestSuite/test_parsing/y_*.json"
62+ Dir [ File . expand_path ( pattern , __dir__ ) ] . each do |filepath |
63+ define_method ( :"test_#{ filepath } " ) { parse ( JSON . read ( filepath ) ) }
6564 end
6665
6766 KNOWN_N_FAILURES = %w[
68- test/JSONTestSuite/test_parsing/ n_string_1_surrogate_then_escape_u.json
69- test/JSONTestSuite/test_parsing/ n_string_1_surrogate_then_escape_u1.json
70- test/JSONTestSuite/test_parsing/ n_string_1_surrogate_then_escape_u1x.json
71- test/JSONTestSuite/test_parsing/ n_string_1_surrogate_then_escape.json
72- test/JSONTestSuite/test_parsing/ n_string_incomplete_escaped_character.json
73- test/JSONTestSuite/test_parsing/ n_string_incomplete_surrogate_escape_invalid.json
74- test/JSONTestSuite/test_parsing/ n_string_incomplete_surrogate.json
75- test/JSONTestSuite/test_parsing/ n_string_invalid_unicode_escape.json
76- test/JSONTestSuite/test_parsing/ n_structure_100000_opening_arrays.json
77- test/JSONTestSuite/test_parsing/ n_structure_open_array_object.json
78- test/JSONTestSuite/test_parsing/ n_structure_whitespace_formfeed.json
67+ n_string_1_surrogate_then_escape_u.json
68+ n_string_1_surrogate_then_escape_u1.json
69+ n_string_1_surrogate_then_escape_u1x.json
70+ n_string_1_surrogate_then_escape.json
71+ n_string_incomplete_escaped_character.json
72+ n_string_incomplete_surrogate_escape_invalid.json
73+ n_string_incomplete_surrogate.json
74+ n_string_invalid_unicode_escape.json
75+ n_structure_100000_opening_arrays.json
76+ n_structure_open_array_object.json
77+ n_structure_whitespace_formfeed.json
7978 ]
8079
81- Dir [ "test/JSONTestSuite/test_parsing/n_*.json" ] . each do |filepath |
80+ pattern = "JSONTestSuite/test_parsing/n_*.json"
81+ Dir [ File . expand_path ( pattern , __dir__ ) ] . each do |filepath |
8282 define_method ( :"test_#{ filepath } " ) do
83- skip if KNOWN_N_FAILURES . include? ( filepath )
83+ skip if KNOWN_N_FAILURES . include? ( File . basename ( filepath ) )
8484
8585 assert_raises ( JSON ::Parser ::ParseError ) do
8686 JSON . parse ( JSON . read ( filepath ) )
0 commit comments