-
Notifications
You must be signed in to change notification settings - Fork 145
Expand file tree
/
Copy pathstdio_capture_dap_test.rb
More file actions
40 lines (32 loc) · 1.1 KB
/
stdio_capture_dap_test.rb
File metadata and controls
40 lines (32 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true
require_relative '../support/protocol_test_case'
module DEBUGGER__
class StdioCaptureDAPTest < ProtocolTestCase
PROGRAM = <<~RUBY
1| $stdout.puts "stdout message"
2| $stderr.puts "stderr message"
3| a = 1
RUBY
def test_stdout_captured_as_output_event
run_protocol_scenario PROGRAM, cdp: false do
req_add_breakpoint 3
req_continue
stdout_event = find_response :event, 'output', 'V<D'
assert_equal 'stdout', stdout_event.dig(:body, :category)
assert_match(/stdout message/, stdout_event.dig(:body, :output))
req_terminate_debuggee
end
end
def test_stderr_captured_as_output_event
run_protocol_scenario PROGRAM, cdp: false do
req_add_breakpoint 3
req_continue
find_response :event, 'output', 'V<D'
stderr_event = find_response :event, 'output', 'V<D'
assert_equal 'stderr', stderr_event.dig(:body, :category)
assert_match(/stderr message/, stderr_event.dig(:body, :output))
req_terminate_debuggee
end
end
end
end