summaryrefslogtreecommitdiff
path: root/test/irb/test_debug_cmd.rb
AgeCommit message (Collapse)Author
2024-02-16[ruby/irb] Support repeating debugger input by passing empty inputStan Lo
to it (https://github.com/ruby/irb/pull/856) * Test IRB's behaviour with empty input * Handle empty input and pass it to debugger Since `rdbg` accepts empty input to repeat the previous command, IRB should take empty input in `irb:rdbg` sessions and pass them to the debugger. Currently, IRB simply ignores empty input and does nothing. This commit creates `EmptyInput` to represent empty input so it can fit into the current IRB's input processing flow in `Irb#eval_input`. https://github.com/ruby/irb/commit/0e9db419be
2024-02-11[ruby/irb] Polish the exit! command and its testsStan Lo
(https://github.com/ruby/irb/pull/867) * Remove IRB.irb_exit! method It's not necessary to introduce a new method just for the exit! command at this moment. * Rename ExitForcedAction to ForceExit * Move force exit tests to a dedicated file * Fix nested history saving with exit! command Because we switched to use `Kernel#exit` instead of `exit!`, the outer session's ensure block in `Irb#run` will be run, which will save the history. This means the separate check to save history when force exiting is no longer necessary. * execute_lines helper should also capture IRB setup's output This prevents setup warnings from being printed to test output while allowing those output to be tested. * Update readme https://github.com/ruby/irb/commit/899d10ade1
2024-02-10[ruby/irb] Introduce exit! commandIgnacio Chiazzo Cardarello
(https://github.com/ruby/irb/pull/851) * Added failing test for when writing history on exit * Save history on exit * Exit early when calling Kernel.exit * use status 0 for kernel.exit * Added test for nested sessions * Update lib/irb.rb --------- https://github.com/ruby/irb/commit/c0a5f31679 Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-11-30[ruby/irb] Page evaluation result's outputStan Lo
(https://github.com/ruby/irb/pull/784) * Page evaluation result's output This will make it easier to work with long output that exceeds the terminal's height. * Use consistent TERM in rendering tests This makes sure we get consistent result on all platforms. https://github.com/ruby/irb/commit/4fedce93d3
2023-11-26[ruby/irb] Support disabling pagerStan Lo
(https://github.com/ruby/irb/pull/783) With either `IRB.conf[:USE_PAGER] = false` or `--no-pager` commnad line flag. I decided use `--no-pager` instead of `--use-pager` because it matches with Pry and git's command line flags. https://github.com/ruby/irb/commit/df1c3b9042
2023-08-29[ruby/irb] Improve help/show_cmds message during debuggerStan Lo
integration (https://github.com/ruby/irb/pull/693) * `help` should display debugger's help during irb:rdbg session * Update `show_cmds`'s output when in irb:rdbg session https://github.com/ruby/irb/commit/4029c2e564
2023-08-21[ruby/irb] Avoid overriding user's `irb_name` setting in debuggerStan Lo
integration (https://github.com/ruby/irb/pull/688) * Avoid overriding user's irb_name setting in debugger integration Instead of always setting `irb_name` to `irb:rdbg`, it should respect the user's setting and only append `:rdbg` to it. * Introduce write_rc test helper https://github.com/ruby/irb/commit/2ce7593351
2023-08-13[ruby/irb] Support seamless integration with ruby/debugStan Lo
(https://github.com/ruby/irb/pull/575) * Support native integration with ruby/debug * Prevent using multi-irb and activating debugger at the same time Multi-irb makes a few assumptions: - IRB will manage all threads that host sub-irb sessions - All IRB sessions will be run on the threads created by IRB itself However, when using the debugger these assumptions are broken: - `debug` will freeze ALL threads when it suspends the session (e.g. when hitting a breakpoint, or performing step-debugging). - Since the irb-debug integration runs IRB as the debugger's interface, it will be run on the debugger's thread, which is not managed by IRB. So we should prevent the 2 features from being used at the same time. To do that, we check if the other feature is already activated when executing the commands that would activate the other feature. https://github.com/ruby/irb/commit/d8fb3246be
2023-08-11[ruby/irb] Skip integration tests in core CIStan Lo
(https://github.com/ruby/irb/pull/677) We already skipped history integration tests in core CI in #675 due to suspicion on nested IRB sessions don't work on certain operating systems. But after #669, the evaluation integration test also started to fail on some Core CI suites. So, it looks like the integration test setup may not work in Core CI, at least in some suites. Consider `ruby/irb` already has rather sophisticated test suite, I think it's better to skip the integration tests in core CI for now. https://github.com/ruby/irb/commit/6f49b4c108
2023-08-04[ruby/irb] Store integration tests' envs in an ivarStan Lo
(https://github.com/ruby/irb/pull/668) https://github.com/ruby/irb/commit/bbd20445ea
2023-08-02[ruby/irb] Extract integration testing helpers out of debug commandStan Lo
tests (https://github.com/ruby/irb/pull/660) The ability to run a test case in a subprocess is useful for testing many other features, like nested IRB sessions. So I think it's worth extracting them into a new test case class. https://github.com/ruby/irb/commit/73b7a895f8
2023-06-02[ruby/irb] Require `test/lib` helpers from main test helperStan Lo
(https://github.com/ruby/irb/pull/595) Because they are handled differently in `ruby/irb` and `ruby/ruby`.
2023-06-01[ruby/irb] Improve debug command testsStan Lo
(https://github.com/ruby/irb/pull/594) * Use require_relative for envutil.rb Requiring test helper files with `require_relative` allows running the tests with `ruby -Itest test/irb/test_debug_cmd.rb` without having to set up the load path. * Replace reline hack with TERM=dumb
2023-05-17[ruby/irb] Fix Test timedout in test_debug_cmdtomoya ishida
(https://github.com/ruby/irb/pull/582) * Suppress Reline::IOGate.cursor_pos writing escape sequence in test_debug_cmd * Force use Reline::GeneralIO as Reline::IOGate and remove RUBY_DEBUG_NO_RELINE option for debug test
2022-12-19[ruby/irb] PTY module is platform dependentNobuyoshi Nakada
https://github.com/ruby/irb/commit/dbb3dc72ff
2022-12-09[ruby/irb] Fix step command (https://github.com/ruby/irb/pull/477)Stan Lo
The current `next` pre-command workaround on IRB source stepping moves the location by 1 extra line. A better way is to make `debug` skip IRB frames completely, which is what this commit does. It also fixes the step command's test. The `|` in regexp was not escaped so it was always incorrectly matched.
2022-12-08[ruby/irb] Kill PTY process after test is finishedStan Lo
(https://github.com/ruby/irb/pull/471) The killing/waiting logic is borrowed from ruby/debug: https://github.com/ruby/debug/blob/ec5ae5aebd61a99dc84028d8dffa8e7e165c1ec6/test/support/test_case.rb#L107-L136
2022-12-05[ruby/irb] Close leaked pty IOsNobuyoshi Nakada
https://github.com/ruby/irb/commit/cc9b1d7ba8
2022-12-02[ruby/irb] Disable debug cmd tests based on project structureStan Lo
instead of env (https://github.com/ruby/irb/pull/466) It's hard to find an env var that's universally set in all Ruby CI environments but not in local. Checking gemspec seems to be a better way as `syntax_suggest` already uses it for a while. https://github.com/ruby/syntax_suggest/blob/d8f1bca297a392b80b5d167e2be07cf6ac4feae3/spec/spec_helper.rb#L47
2022-12-02[ruby/irb] This doesn't work on RubyCI eitherTakashi Kokubun
http://rubyci.s3.amazonaws.com/rhel_zlinux/ruby-master/log/20221202T063302Z.fail.html.gz http://rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20221202T053006Z.fail.html.gz http://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20221202T063002Z.fail.html.gz http://rubyci.s3.amazonaws.com/osx1013/ruby-master/log/20221202T054503Z.fail.html.gz https://github.com/ruby/irb/commit/13c2484d59
2022-12-02[ruby/irb] Skip debug command tests on ruby/rubyTakashi Kokubun
Stan has said these tests could be excluded if they don't work on ruby/ruby CI. https://github.com/ruby/irb/commit/11e779ecb7
2022-12-02[ruby/irb] Use the proper ruby command and library pathNobuyoshi Nakada
https://github.com/ruby/irb/commit/1416cc1871
2022-12-02[ruby/irb] Test debug commands without yamatanoorotiStan Lo
(https://github.com/ruby/irb/pull/464) * Add debug command tests that don't require yamatanooroti * Remove debug command related yamatanooroti tests As discussed in https://github.com/ruby/irb/pull/449#pullrequestreview-1187255149, we should avoid adding new tests that need yamatanooroti because it's not maintained by the Ruby org. And since debug commands are now tested in `test/irb/test_debug_cmd.rb`, we don't need these tests anymore. * Test against latest debug gem https://github.com/ruby/irb/commit/78a8aa8834