File tree 2 files changed +29
-8
lines changed
2 files changed +29
-8
lines changed Original file line number Diff line number Diff line change @@ -334,9 +334,12 @@ def execute_dap_scenario scenario
334
334
335
335
attach_to_dap_server
336
336
scenario . call
337
+ rescue Test ::Unit ::AssertionFailedError => e
338
+ is_assertion_failure = true
339
+ raise e
337
340
ensure
338
341
kill_remote_debuggee test_info
339
- if test_info . failed_process
342
+ if test_info . failed_process && ! is_assertion_failure
340
343
flunk create_protocol_message "Expected the debuggee program to finish"
341
344
end
342
345
# Because the debuggee may be terminated by executing the following operations, we need to run them after `kill_remote_debuggee` method.
@@ -365,9 +368,12 @@ def execute_cdp_scenario_ scenario
365
368
res = find_response :method , 'Debugger.paused' , 'C<D'
366
369
@crt_frames = res . dig ( :params , :callFrames )
367
370
scenario . call
371
+ rescue Test ::Unit ::AssertionFailedError => e
372
+ is_assertion_failure = true
373
+ raise e
368
374
ensure
369
375
kill_remote_debuggee test_info
370
- if test_info . failed_process
376
+ if test_info . failed_process && ! is_assertion_failure
371
377
flunk create_protocol_message "Expected the debuggee program to finish"
372
378
end
373
379
# Because the debuggee may be terminated by executing the following operations, we need to run them after `kill_remote_debuggee` method.
Original file line number Diff line number Diff line change 3
3
require_relative 'protocol_test_case'
4
4
5
5
module DEBUGGER__
6
- class TestFrameworkTestHOge < ProtocolTestCase
7
- PROGRAM = <<~RUBY
8
- 1| a=1
9
- RUBY
10
-
6
+ class TestProtocolTestCase < ProtocolTestCase
11
7
def test_the_test_fails_when_debuggee_doesnt_exit
8
+ program = <<~RUBY
9
+ 1| a=1
10
+ RUBY
11
+
12
12
assert_fail_assertion do
13
- run_protocol_scenario PROGRAM do
13
+ run_protocol_scenario program do
14
+ end
15
+ end
16
+ end
17
+
18
+ def test_the_assertion_failure_takes_presedence_over_debuggee_not_exiting
19
+ program = <<~RUBY
20
+ 1| a = 2
21
+ 2| b = 3
22
+ RUBY
23
+
24
+ assert_raise_message ( /<\" 100\" > expected but was/ ) do
25
+ run_protocol_scenario program do
26
+ req_add_breakpoint 2
27
+ req_continue
28
+ assert_repl_result ( { value : '100' , type : 'Integer' } , 'a' )
14
29
end
15
30
end
16
31
end
You can’t perform that action at this time.
0 commit comments