path: root/test/irb
AgeCommit message (Collapse)Author
2022-06-29[ruby/irb] Properly reset USE_COLORIZE after changing it in testsst0012
Some context tests assigns USE_COLORIZE to false and never change it back. This can potentially affect other tests' result as the default should be nil (activated) instead.
2022-06-28[ruby/irb] Centralize coloring control ( Lo
* Use colorable: argument as the only coloring control * Centalize color controling logic at Color.colorable? There are 2 requirements for coloring output: 1. It's supported on the platform 2. The user wants it: `IRB.conf[:USE_COLORIZE] == true` Right now we check 1 and 2 separately whenever we colorize things. But it's error-prone because while 1 is the default of `colorable` parameter, 2 always need to manually checked. When 2 is overlooked, it causes issues like And there's 0 case where we may want to colorize even when the user disables it. So I think we should merge 2 into `Color.colorable?` so it can be automatically picked up. * Add tests for all inspect modes * Simplify inspectors' coloring logic * Replace use_colorize? with Color.colorable? * Remove Context#use_colorize cause it's redundant
2022-06-26[ruby/irb] Set prompt mode explictlyNobuyoshi Nakada
2022-06-26[ruby/irb] Require stringio to use StringIONobuyoshi Nakada
2022-06-26[ruby/irb] Ensure stdout is a TTY before calling winsizePeter Jones
When outputting a (possibly truncated) value, IRB will query the window size. However, if IRB was piped to another process, stdout will no longer be a TTY and will not support the `winsize` method. This fix ensure that stdout is a TTY.
2021-12-21[ruby/irb] Check colorize option correctly to clear char attr and don't use ↵aycabta
it for tests
2021-12-20[ruby/irb] Remove unnecessary space in regexpaycabta
2021-12-20[ruby/irb] Add East Asian Ambiguous Width to irb_info commandaycabta
2021-12-03[ruby/irb] Examine indentation of in keyword when trying to type includeKaíque Kandy Koga
Use in_keyword_case_scope? Return fast
2021-12-02Compatibility with IRBschneems
Instead of accessing the struct as an array, access it via methods. There are other places inside of this file already using this API (for example This commit moves all struct array-ish calls to use their method calls instead. It is also ~1.23 faster accessing values via a method instead of as an array according to this microbenchmark: ```ruby Elem =, :event, :tok, :state, :message) do def initialize(pos, event, tok, state, message = nil) super(pos, event, tok,, message) end # ... def to_a a = super a.pop unless a.empty? a end end class ElemClass attr_accessor :pos, :event, :tok, :state, :message def initialize(pos, event, tok, state, message = nil) @pos = pos @event = event @tok = tok @state = @message = message end def to_a if @message [@pos, @event, @tok, @state, @message] else [@pos, @event, @tok, @state] end end end # stub state class creation for now class State; def initialize(val); end; end ``` ```ruby Benchmark.ips do |x|"struct") { struct[1] }"class ") { from_class.event }! end; nil ``` ``` Warming up -------------------------------------- struct 1.624M i/100ms class 1.958M i/100ms Calculating ------------------------------------- struct 17.139M (± 2.6%) i/s - 86.077M in 5.025801s class 21.104M (± 3.4%) i/s - 105.709M in 5.015193s Comparison: class : 21103826.3 i/s struct: 17139201.5 i/s - 1.23x (± 0.00) slower ``` Notes: Merged:
2021-11-05Skip TestIRB::TestInit#test_recovery_sigint on SolarisYusuke Endoh
The test randomly gets stuck on Solaris: ``` 1) Error: TestIRB::TestInit#test_recovery_sigint: Timeout::Error: execution of assert_in_out_err expired timeout (100.0 sec) pid 3195 killed by SIGTERM (signal 15) | Switch to inspect mode. | exit | ``` I investigated the issue but I couldn't figure it out. This random failure is noisy, which makes it difficult to track the CI. So I skip the test on Soalris. Contribution is welcome.
2021-10-13[ruby/irb] Ignore parenthesis during completionKaíque Kandy Koga
Rename method
2021-10-11[ruby/irb] Set default return_formataycabta
2021-10-11[ruby/irb] Clean up a duplicated definitionTakashi Kokubun
I simply forgot deleting it.
2021-10-10[ruby/irb] trufflruby fails on the show_source testTakashi Kokubun
2021-10-10[ruby/irb] Add a test of find_end for show_source commandTakashi Kokubun
2021-10-08[ruby/irb] Add tests for truncated show doc dialogaycabta
But pending them now because they need dummy document data to show doc.
2021-09-24Pend test_complete_require_library_name_firstaycabta
2021-09-23[ruby/irb] Ignore any encoding errors while symbol completionNobuyoshi Nakada
2021-09-22[ruby/irb] Use typed spaces when the line is inside the here documentsKaíque Kandy Koga
Use first method instead of square brackets to support 2.5 and 2.6 versions Use tokens Clear check_newline_depth_difference
2021-09-21[ruby/irb] Fix argument orderNobuyoshi Nakada
2021-09-11[ruby/irb] Ignore invalid 3 colons in completionaycabta
2021-09-10[ruby/irb] Tests may not execute in the source directoryNobuyoshi Nakada
2021-09-10Find irb command path in testaycabta
2021-09-10[ruby/irb] Pend on trufflerubyaycabta
2021-09-10[ruby/irb] Remove an unused variableaycabta
2021-09-10[ruby/irb] Avoid loading files' local variables [Bug #17623]Marc-Andre Lafortune
2021-09-10[ruby/irb] Add yamatanooroti test for symbol with backtickaycabta
2021-09-10[ruby/irb] Support symbol with backtickaycabta
2021-09-08[ruby/irb] Use "csv" for testaycabta
The "csv" doesn't conflict with other stdlib names in any Ruby processing system.
2021-09-08[ruby/irb] Show lib name first because it's the most common use caseaycabta
2021-09-04[ruby/irb] Suppress "assigned but unused variable" warningaycabta
2021-09-04[ruby/irb] Add an assertion to check completion "var.method" to get correct ↵aycabta
2021-09-04[ruby/irb] Retrieve completed receiver that is a module or class correctlyaycabta
2021-09-04[ruby/irb] Use autocomplete with show doc dialog that uses Reline::Key in testsaycabta
2021-09-03[ruby/irb] Add TODO comment to remove disabling autocomplete lateraycabta
2021-09-03[ruby/irb] Disable autocomplete in yamatanooroti testaycabta
2021-09-02[ruby/irb] Detect the variable class to show docaycabta
2021-08-30[ruby/irb] Relax backtrace nest levelsNobuyoshi Nakada
2021-08-30[ruby/irb] Added the extra stdout message with test-unitHiroshi SHIBATA
2021-08-30[ruby/irb] Use capture_output instead of capture_ioHiroshi SHIBATA
2021-08-30[ruby/irb] Use pend instead of skipHiroshi SHIBATA
2021-08-30Add --autocomplete / --noautocomplete optionsaycabta
2021-08-30[ruby/irb] Remove path settings for debuggingaycabta
2021-07-16[ruby/irb] Show code page by irb_info on Windowsaycabta
2021-07-16[ruby/irb] Escape space in free-spacing modeaycabta
2021-07-11[ruby/irb] Show LANG and LC_ALL env by irb_infoaycabta
Co-authored-by: Nobuyoshi Nakada <>
2021-06-30[ruby/irb] Fix error on `ls object_cant_define_singleton`Masataka Pocke Kuwabara
such as `ls 42`, `ls :sym` and so on
2021-06-23Strip trailing spacesNobuyoshi Nakada
2021-06-22[ruby/irb] Sort ls result ordered by anscestryKeiko Kaneko