Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/console/debugger_local_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_raised_is_accessible_from_repl
type "catch Exception"
type "c"
type "_raised"
assert_line_text(/#<NameError: undefined local variable or method `foo' for main:Object/)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the exception here is printed with #inspect because that's how debugger prints objects from console (pp + width limit). So it's not produced by the test framework.

assert_line_text(/undefined local variable or method `foo' for main:Object/)
type "c"
end
end
Expand All @@ -43,7 +43,7 @@ def test_raised_is_accessible_from_command
debug_code(program) do
type "catch Exception pre: p _raised"
type "c"
assert_line_text(/#<NameError: undefined local variable or method `foo' for main:Object/)
assert_line_text(/undefined local variable or method `foo' for main:Object/)
type "c"
end
end
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_raised_doesnt_leak_to_program_binding

# stops for NoMethodError because _raised is not defined in the program
type "_raised"
assert_line_text(/NameError: undefined local variable or method `_raised' for main:Object/)
assert_line_text(/undefined local variable or method `_raised' for main:Object/)
type "c"
end
end
Expand Down Expand Up @@ -155,7 +155,7 @@ def test_raised_doesnt_leak_to_program_binding
type "c"
# stops for NoMethodError because _return is not defined in the program
type "_raised"
assert_line_text(/NameError: undefined local variable or method `_return' for main:Object/)
assert_line_text(/undefined local variable or method `_return' for main:Object/)
type "c"
end
end
Expand Down
8 changes: 4 additions & 4 deletions test/console/record_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,18 @@ def test_1629263892
end
end

class RecordOnAfterStoppingOnceTest < TestCase
class RecordOnAfterStoppingOnceTest < ConsoleTestCase
def program
<<~RUBY
1| a=1
2|
2|
3| b=1
4|
4|
5| c=1
6| p a
RUBY
end

def test_1656237686
debug_code(program) do
type 'record on'
Expand Down
2 changes: 1 addition & 1 deletion test/support/console_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def debug_code(program, remote: true, &test_steps)
end
rescue Exception => e
th.each(&:kill)
flunk e.inspect
flunk "#{e.class.name}: #{e.message}"
end
elsif remote && !NO_REMOTE
debug_code_on_local
Expand Down
2 changes: 1 addition & 1 deletion test/support/protocol_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def send_request command, **kw
params: kw
end
rescue StandardError => e
flunk create_protocol_message "Failed to send request because of #{e.inspect}"
flunk create_protocol_message "Failed to send request because of #{e.class.name}: #{e.message}"
end

def send_dap_request command, **kw
Expand Down