File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -376,8 +376,8 @@ Please note that both `value` and `type` need to be strings.
376
376
377
377
Passes if both conditions are true:
378
378
379
- 1 . The number of expected pattern matches the number of threads.
380
- 2 . The expected patterns match the thread names in the given order.
379
+ 1 . The number of expected patterns matches the number of threads.
380
+ 2 . Every pattern matches a thread name. Notice that the order of threads info is not guaranteed .
381
381
382
382
Example:
383
383
Original file line number Diff line number Diff line change @@ -234,15 +234,22 @@ def assert_threads_result(expected_names)
234
234
case ENV [ 'RUBY_DEBUG_TEST_UI' ]
235
235
when 'vscode'
236
236
res = send_dap_request 'threads'
237
+ failure_msg = FailureMessage . new { create_protocol_message "result:\n #{ JSON . pretty_generate res } ." }
237
238
238
239
threads = res . dig ( :body , :threads )
239
- failure_msg = FailureMessage . new { create_protocol_message "result:\n #{ JSON . pretty_generate res } " }
240
240
241
241
assert_equal expected_names . count , threads . count , failure_msg
242
242
243
- expected_names . each_with_index do |expected , index |
244
- assert_match expected , threads [ index ] [ :name ] , failure_msg
243
+ thread_names = threads . map { |t | t [ :name ] }
244
+
245
+ expected_names . each do |expected |
246
+ thread_names . reject! do |name |
247
+ name . match? ( expected )
248
+ end
245
249
end
250
+
251
+ failure_msg = FailureMessage . new { create_protocol_message "result:\n #{ JSON . pretty_generate res } .\n Expect all thread names to be matched. Unmatched threads:" }
252
+ assert_equal [ ] , thread_names , failure_msg
246
253
end
247
254
end
248
255
You can’t perform that action at this time.
0 commit comments