summaryrefslogtreecommitdiff
path: root/test/irb
AgeCommit message (Collapse)Author
2020-05-09Fix typosKazuhiro NISHIYAMA
2020-05-08Restore the external and internal encodings of STDIN, STDOUT, and STDERRYusuke Endoh
IRB::ReadlineInputMethod#initialize changes them via IRB.set_encoding.
2020-05-08test/irb/test_cmd.rb: clear IRB.@CONF on setupYusuke Endoh
It caches a path to .irbrc file, which has caused random failure: ``` 1) Failure: TestIRB::ExtendCommand#test_irb_info_multiline [/home/mame/work/ruby/test/irb/test_cmd.rb:49]: Expected / Ruby\sversion: .+\n IRB\sversion:\sirb .+\n InputMethod:\sReidlineInputMethod\swith\sReline .+ and .+\n \.irbrc\spath: .+ /x to match "Ruby version: 2.8.0\n" + "IRB version: irb 1.2.3 (2020-02-15)\n" + "InputMethod: ReidlineInputMethod with Reline 0.1.4 and /tmp/test_reline_config_155659/.inputrc\n". ```
2020-04-30[ruby/irb] Restore the default encodingsNobuyoshi Nakada
IRB::ReadlineInputMethod#initialize sets via IRB.set_encoding.
2020-04-30[ruby/irb] Suppress messages switching inspect modeNobuyoshi Nakada
2020-04-30[ruby/irb] Relaxed regexp for readlineNobuyoshi Nakada
Readline::VERSION may not be a single word, e.g EditLine wrapper when linked with editline.
2020-04-29[ruby/irb] Check existence of rc files in irb_info commandaycabta
https://github.com/ruby/irb/commit/cdbb9dfc9f
2020-04-29[ruby/irb] Add irb_info commandaycabta
https://github.com/ruby/irb/commit/a6fe58e916
2020-03-26[ruby/irb] Suppress crashing when EncodingError has occurred without linenoaycabta
https://github.com/ruby/irb/commit/13572d8cdc
2020-02-29Fix a typo [ci skip]Kazuhiro NISHIYAMA
2020-02-21[ruby/irb] `yield` outside method definition is a syntax errorNobuyoshi Nakada
https://github.com/ruby/irb/commit/dbc7b059c7
2020-02-15[ruby/irb] fix reserved words and completion for themNobuhiro IMAI
https://github.com/ruby/irb/commit/6184b227ad
2020-02-14test/irb/test_completion.rb: suppress a warning: unused literal ignoredYusuke Endoh
2020-02-12Add test_complete_symbolaycabta
The previous version of the test method used a symbol, ":abcdefg" to complete but longer symbols that can be completed are defined by other test methods of other libs.
2020-02-12Revert "[ruby/irb] Add test_complete_symbol"Hiroshi SHIBATA
This reverts commit 3af3431c2c145134996e66f3d8d9ade8ad81bde0.
2020-02-12[ruby/irb] Fix auto indent with closed braceaycabta
A closed brace in auto-indent shouldn't affect the next brace in the same line, but it behaves like below: p() { } It's a bug. https://github.com/ruby/irb/commit/fbe59e344f
2020-02-12[ruby/irb] Check doc namespace correctlyaycabta
IRB::InputCompletor::PerfectMatchedProc crashes when doc not found because a variable name was incorrect. https://github.com/ruby/irb/commit/889fd4928f
2020-02-12[ruby/irb] Add test_complete_symbolaycabta
https://github.com/ruby/irb/commit/dbbf086c1f
2020-01-21[ruby/irb] Add newline_before_multiline_outputKenta Murata
https://github.com/ruby/irb/commit/9eb1801a66
2020-01-14[ruby/irb] Fix crashing when multiple open braces per lineBen
https://github.com/ruby/irb/issues/55 If we had put multiple open braces on a line the with no closing brace spaces_of_nest array keeps getting '0' added to it. This means that when we pop off of this array we are saying that we should be in position zero for the next line. This is an issue because we don't always want to be in position 0 after a closing brace. Example: ``` [[[ ] ] ] ``` In the above example the 'spaces_of_nest' array looks like this after the first line is entered: [0,0,0]. We really want to be indented 4 spaces for the 1st closing brace 2 for the 2nd and 0 for the 3rd. i.e. we want it to be: [0,2,4]. We also saw this issue with a heredoc inside of an array. ``` [<<FOO] hello FOO ``` https://github.com/ruby/irb/commit/80c69c8272
2020-01-14[ruby/irb] Fix newline depth with multiple bracesBen
This commit fixes the check_newline_depth_difference method to multiple open braces on one line into account. Before this change we were subtracting from the depth in check_newline_depth_difference on every open brace. This is the right thing to do if the opening and closing brace are on the same line. For example in a method definition we have an opening and closing parentheses we want to add 1 to our depth, and then remove it. ``` def foo() end ``` However this isn't the correct behavior when the brace spans multiple lines. If a brace spans multiple lines we don't want to subtract from check_newline_depth_difference and we want to treat the braces the same way as we do `end` and allow check_corresponding_token_depth to pop the correct depth. Example of bad behavior: ``` def foo() [ ] puts 'bar' end ``` Example of desired behavior: ``` def foo() [ ] puts 'bar' end ``` https://github.com/ruby/irb/commit/7dc8af01e0
2020-01-01Add load path and require for ruby/rubyaycabta
2020-01-01[ruby/irb] Fix lib name of OpenStructaycabta
https://github.com/ruby/irb/commit/1f3a84ab6b
2019-12-31Add "require 'openstruct'" what is forgottenaycabta
2019-12-31[ruby/irb] Add tests for RubyLexBen
The set_auto_indent method calculates the correct number of spaces for indenting a line. We think there might be a few bugs in this method so we are testing the current functionality to make sure nothing breaks when we address those bugs. Example test failure: ``` 1) Failure: TestIRB::TestRubyLex#test_auto_indent [/Users/Ben/Projects/irb/test/irb/test_ruby_lex.rb:75]: Calculated the wrong number of spaces for: def each_top_level_statement initialize_input catch(:TERM_INPUT) do loop do begin prompt unless l = lex throw :TERM_INPUT if @line == '' else . <10> expected but was <12>. ``` https://github.com/ruby/irb/commit/752d5597ab
2019-12-14[ruby/irb] Restore environment variablesNobuyoshi Nakada
https://github.com/ruby/irb/commit/236590882c
2019-11-28Add require "irb" to test/irb/test_completion.rbaycabta
2019-11-28Fix regexp to complete complex literalaycabta
IRB completion logic always needed exponential notation for complex literal such as 3e6i but it's bug. I fixed to support complex literal without exponential notation such as 3i.
2019-11-21Use singleline/multiline instead of readline/reidlineaycabta
2019-11-20Generate history file path correctly when $HOME/.irbrc doesn't existaycabta
2019-11-13Suppress warnings except for when last evaluationaycabta
Co-authored-by: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
2019-11-10qsymbols and symbols should be colored as SymbolTakashi Kokubun
2019-11-10Colorize on_symbols_beg (%I)Takashi Kokubun
2019-11-10Colorize string quotes as boldTakashi Kokubun
like pry
2019-10-14IRB colorize: take into account recursive arrays and hashes (#2555)Ary Borenszweig
[Bug #16250]
2019-09-24Changed numbered parameter prefixNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2431
2019-08-16Set IRB::Context#return_format on test clarifyaycabta
2019-08-16Don't echo results of assignment expressionsSteven Willis
2019-08-08Aliases capture_output to capture_io for test-unit compatiblity.Hiroshi SHIBATA
2019-08-06Revert "Don't echo results of assignment expressions"aycabta
This reverts commit 1ee88c51b3c319b74b69540e111e4a1c24833cad.
2019-08-06Don't echo results of assignment expressionsSteven Willis
2019-06-13Clarify the Ruby version support status in IRB moreTakashi Kokubun
2019-06-13make sync-default-gems GEM=irbTakashi Kokubun
Upgrade IRB to https://github.com/ruby/irb/commit/41ea43a4a732e094acfa1b0fc1473fdcda9e6227 Mostly backport changes.
2019-06-12Another incomplete string caseNobuyoshi Nakada
2019-06-12Ripper::Lexer: fallback parse error token to the previous oneNobuyoshi Nakada
2019-06-04Remove conflict resolution mistake [ci skip]Takashi Kokubun
in de541fe1961370e64541d73c96cf790d30f28604 :bow:
2019-06-04Improve test_color to prevent regressionTakashi Kokubun
Actually de541fe1961370e64541d73c96cf790d30f28604 was still needed. This commit would improve the test coverage using the branch.
2019-06-04colorize_code must return escaped textTakashi Kokubun
This was needed before 0c459af7c233adb5f44022350bfe8fa132d8053e but it could be actually useless now. But I added this anyway just in case.
2019-06-04Colorize error charactersNobuyoshi Nakada
* lib/irb/color.rb (IRB::Color.scan): ignore "incomplete end of input" error only, to colorize invalid characters, e.g., control characters, and invalid symbols, as errors.
2019-05-31Warn compile_error only when input is finishedTakashi Kokubun
Let's say we are in progress to write `"foo"`: ``` irb> "fo ``` at this moment, nothing is wrong. It would be just a normal way to write `"foo"`. Prior to this commit, the `fo` part was warned because of 5b64d7ac6e7cbf759b859428f125539e58bac0bd. But I think warning such a normal input is not valuable for users. However, we'd like to warn `:@1` or `@@1` which is also a syntax error. Then this commit switches the syntax highlight based on whether the input text is finished or not. When it's not finished yet, it does not warn compile_error.