aboutsummaryrefslogtreecommitdiffstats
path: root/test/irb
Commit message (Collapse)AuthorAgeFilesLines
* rubygems is needed to run solo-file testKoichi Sasada2020-07-151-0/+1
|
* Fix typosKazuhiro NISHIYAMA2020-05-091-4/+4
|
* Restore the external and internal encodings of STDIN, STDOUT, and STDERRYusuke Endoh2020-05-081-0/+4
| | | | IRB::ReadlineInputMethod#initialize changes them via IRB.set_encoding.
* test/irb/test_cmd.rb: clear IRB.@CONF on setupYusuke Endoh2020-05-081-0/+1
| | | | | | | | | | | | | | | | | 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". ```
* [ruby/irb] Restore the default encodingsNobuyoshi Nakada2020-04-301-0/+4
| | | | IRB::ReadlineInputMethod#initialize sets via IRB.set_encoding.
* [ruby/irb] Suppress messages switching inspect modeNobuyoshi Nakada2020-04-301-0/+4
|
* [ruby/irb] Relaxed regexp for readlineNobuyoshi Nakada2020-04-301-1/+1
| | | | | Readline::VERSION may not be a single word, e.g EditLine wrapper when linked with editline.
* [ruby/irb] Check existence of rc files in irb_info commandaycabta2020-04-291-0/+50
| | | | https://github.com/ruby/irb/commit/cdbb9dfc9f
* [ruby/irb] Add irb_info commandaycabta2020-04-291-0/+64
| | | | https://github.com/ruby/irb/commit/a6fe58e916
* [ruby/irb] Suppress crashing when EncodingError has occurred without linenoaycabta2020-03-261-0/+7
| | | | https://github.com/ruby/irb/commit/13572d8cdc
* Fix a typo [ci skip]Kazuhiro NISHIYAMA2020-02-291-1/+1
|
* [ruby/irb] `yield` outside method definition is a syntax errorNobuyoshi Nakada2020-02-211-1/+1
| | | | https://github.com/ruby/irb/commit/dbc7b059c7
* [ruby/irb] fix reserved words and completion for themNobuhiro IMAI2020-02-151-0/+12
| | | | https://github.com/ruby/irb/commit/6184b227ad
* test/irb/test_completion.rb: suppress a warning: unused literal ignoredYusuke Endoh2020-02-141-1/+1
|
* Add test_complete_symbolaycabta2020-02-121-0/+6
| | | | | | 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.
* Revert "[ruby/irb] Add test_complete_symbol"Hiroshi SHIBATA2020-02-121-6/+0
| | | | This reverts commit 3af3431c2c145134996e66f3d8d9ade8ad81bde0.
* [ruby/irb] Fix auto indent with closed braceaycabta2020-02-121-0/+14
| | | | | | | | | | | | 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
* [ruby/irb] Check doc namespace correctlyaycabta2020-02-121-0/+4
| | | | | | | IRB::InputCompletor::PerfectMatchedProc crashes when doc not found because a variable name was incorrect. https://github.com/ruby/irb/commit/889fd4928f
* [ruby/irb] Add test_complete_symbolaycabta2020-02-121-0/+6
| | | | https://github.com/ruby/irb/commit/dbbf086c1f
* [ruby/irb] Add newline_before_multiline_outputKenta Murata2020-01-211-0/+31
| | | | https://github.com/ruby/irb/commit/9eb1801a66
* [ruby/irb] Fix crashing when multiple open braces per lineBen2020-01-141-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ruby/irb] Fix newline depth with multiple bracesBen2020-01-141-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add load path and require for ruby/rubyaycabta2020-01-011-0/+2
|
* [ruby/irb] Fix lib name of OpenStructaycabta2020-01-011-1/+1
| | | | https://github.com/ruby/irb/commit/1f3a84ab6b
* Add "require 'openstruct'" what is forgottenaycabta2019-12-311-0/+1
|
* [ruby/irb] Add tests for RubyLexBen2019-12-311-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ruby/irb] Restore environment variablesNobuyoshi Nakada2019-12-141-8/+10
| | | | https://github.com/ruby/irb/commit/236590882c
* Add require "irb" to test/irb/test_completion.rbaycabta2019-11-281-1/+2
|
* Fix regexp to complete complex literalaycabta2019-11-281-0/+5
| | | | | | 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.
* Use singleline/multiline instead of readline/reidlineaycabta2019-11-211-1/+1
|
* Generate history file path correctly when $HOME/.irbrc doesn't existaycabta2019-11-201-0/+40
|
* Suppress warnings except for when last evaluationaycabta2019-11-131-0/+6
| | | | Co-authored-by: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* qsymbols and symbols should be colored as SymbolTakashi Kokubun2019-11-101-3/+3
|
* Colorize on_symbols_beg (%I)Takashi Kokubun2019-11-101-0/+8
|
* Colorize string quotes as boldTakashi Kokubun2019-11-101-23/+23
| | | | like pry
* IRB colorize: take into account recursive arrays and hashes (#2555)Ary Borenszweig2019-10-141-0/+2
| | | [Bug #16250]
* Changed numbered parameter prefixNobuyoshi Nakada2019-09-241-2/+0
|
* Set IRB::Context#return_format on test clarifyaycabta2019-08-161-0/+1
|
* Don't echo results of assignment expressionsSteven Willis2019-08-162-0/+126
|
* Aliases capture_output to capture_io for test-unit compatiblity.Hiroshi SHIBATA2019-08-081-1/+1
|
* Revert "Don't echo results of assignment expressions"aycabta2019-08-062-126/+0
| | | | This reverts commit 1ee88c51b3c319b74b69540e111e4a1c24833cad.
* Don't echo results of assignment expressionsSteven Willis2019-08-062-0/+126
|
* Clarify the Ruby version support status in IRB moreTakashi Kokubun2019-06-131-13/+19
|
* make sync-default-gems GEM=irbTakashi Kokubun2019-06-134-21/+50
| | | | | | Upgrade IRB to https://github.com/ruby/irb/commit/41ea43a4a732e094acfa1b0fc1473fdcda9e6227 Mostly backport changes.
* Another incomplete string caseNobuyoshi Nakada2019-06-121-0/+2
|
* Ripper::Lexer: fallback parse error token to the previous oneNobuyoshi Nakada2019-06-121-1/+1
|
* Remove conflict resolution mistake [ci skip]Takashi Kokubun2019-06-041-2/+2
| | | | in de541fe1961370e64541d73c96cf790d30f28604 :bow:
* Improve test_color to prevent regressionTakashi Kokubun2019-06-041-2/+1
| | | | | Actually de541fe1961370e64541d73c96cf790d30f28604 was still needed. This commit would improve the test coverage using the branch.
* colorize_code must return escaped textTakashi Kokubun2019-06-041-2/+3
| | | | | This was needed before 0c459af7c233adb5f44022350bfe8fa132d8053e but it could be actually useless now. But I added this anyway just in case.
* Colorize error charactersNobuyoshi Nakada2019-06-041-8/+5
| | | | | | * 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.