File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -323,15 +323,22 @@ def test_seeked_string_io
323
323
end
324
324
325
325
private
326
- def assert_parse_errors_out ( data , **options )
326
+
327
+ {
328
+ "YJIT" => 1 , # for --yjit-call-threshold=1
329
+ "MJIT" => 5 , "RJIT" => 5 , # for --jit-wait
330
+ } . any? do |jit , timeout |
331
+ if ( RubyVM . const_defined? ( jit ) and
332
+ jit = RubyVM . const_get ( jit ) and
333
+ jit . respond_to? ( :enabled? ) and
334
+ jit . enabled? )
335
+ PARSE_ERROR_TIMEOUT = timeout
336
+ end
337
+ end
338
+ PARSE_ERROR_TIMEOUT ||= 0.2
339
+
340
+ def assert_parse_errors_out ( data , timeout : PARSE_ERROR_TIMEOUT , **options )
327
341
assert_raise ( CSV ::MalformedCSVError ) do
328
- timeout = 0.2
329
- if defined? ( RubyVM ::YJIT . enabled? ) and RubyVM ::YJIT . enabled?
330
- timeout = 1 # for --yjit-call-threshold=1
331
- end
332
- if defined? ( RubyVM ::MJIT . enabled? ) and RubyVM ::MJIT . enabled?
333
- timeout = 5 # for --jit-wait
334
- end
335
342
Timeout . timeout ( timeout ) do
336
343
CSV . parse ( data , **options )
337
344
fail ( "Parse didn't error out" )
You can’t perform that action at this time.
0 commit comments