summaryrefslogtreecommitdiff
path: root/test/irb
AgeCommit message (Collapse)Author
2019-05-26Fix scanner event at invalid syntaxNobuyoshi Nakada
* parse.y (parser_yyerror, parser_compile_error): revert r67224 (e5d10cda07b23682e5e4e64d1324e4d3247d4785) "Flush erred token".
2019-05-25Handle keyword symbol in IRB::Color::SymbolStateTakashi Kokubun
2019-05-25Deal with more syntax highlight edge casesTakashi Kokubun
Please refer to the tests again.
2019-05-25Fix more unintended syntax highlightsTakashi Kokubun
See tests for what kind of things are fixed.
2019-05-25Always color Symbol as Yellow on IRB::ColorTakashi Kokubun
Symbol color was made blue as a workaround because it was hard to distinguish `foo`s in `:foo` and `def foo; end` (both are :on_ident). But I wanted to make it yellow like pry. `:Struct` had the same problem in :on_const. Because the :on_const was also blue (but underlined and bold), it was not a big issue. While they're not so problematic since we got a workaround, we also had a more serious issue for highlighting a symbol like `:"a#{b}c"`. The first half was considered as Symbol and the last half was considered as String, because the colorizer did not have a state like a parser. To approach the last issue, I introduced `IRB::Color::SymbolState` which is a thin state manager knowing only "the token is Symbol or not". Having this module magically solves the first two problems as well. So now we can highlight Symbol as yellow in the perfect manner.
2019-05-25Colorize empty embexpr more on IRB::ColorTakashi Kokubun
2019-05-25Support some unhandled syntax highlightTakashi Kokubun
Heredoc, %i, :Foo, { 'a': ... }, ... :'a' is still half-broken.
2019-05-25Clear IRB::Color escape sequence before newlineTakashi Kokubun
because otherwise prompt and other things could be polluted.
2019-05-25Add and use Reline::Unicode.escape_for_printTakashi Kokubun
2019-05-24Incremental syntax highlight for IRB source linesTakashi Kokubun
Closes: https://github.com/ruby/ruby/pull/2202
2019-05-21Copy config to make IRB::Context#use_colorize? functionalTakashi Kokubun
on initialize This fixes https://github.com/ruby/ruby/pull/2188
2019-05-21Add "require 'irb'" to use IRB.confaycabta
2019-04-30Use Ripper for IRBaycabta
The debug option of IRB is deleted because it's just for IRB's pure Ruby parser.
2019-04-28make sync-default-gems GEM=irbTakashi Kokubun
from https://github.com/ruby/irb/commit/e8e79d569ed59fe4ed4fbca968917ce799f02a5e. This colorizes Range object on IRB inspect.
2019-04-28make sync-default-gems GEM=irbTakashi Kokubun
from https://github.com/ruby/irb/commit/96f05e726879e9858eb015c8d043c9f52b864ff9. Just syncing newer test changes so that conflicts do not happen when trunk is modified and we need to backport that to ruby/irb.
2019-04-28make sync-default-gems GEM=irbTakashi Kokubun
from https://github.com/ruby/irb/commit/44301d382794d91e2caa16dd4efe62439e0041d8. This includes some fixes for string interpolation highlight fixes.
2019-04-28* remove trailing spaces.git
2019-04-28make sync-default-gems GEM=irbTakashi Kokubun
from https://github.com/ruby/irb/commit/89e9add06da3fd5f9ce91a2f5fa0b0190aa5d42f. This adds syntax highlight support for Module on inspect. In addition to that, I'm adding a trailing space in test_color.rb for testing ruby-commit-hook's auto-style.
2019-04-27make sync-default-gems GEM=irbTakashi Kokubun
Synced from https://github.com/ruby/irb/commit/5feb361ed80736efa5b2c2b629837ec2a5fc2cdb. This includes a support to colorize named Class instance on IRB inspect.
2019-04-27make sync-default-gems GEM=irbTakashi Kokubun
Backport changes from ruby/irb.
2019-04-27suppress warning in test/irbnaruse
https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos7/ruby-trunk/log/20190421T040003Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e Re-committing https://github.com/ruby/ruby/commit/7f09b5e9da8f83f84c5b6ae7a644a562811fec73
2019-04-26Revert "Class instance should be also colorable on IRB"Takashi Kokubun
This reverts commit 6669c966d2744f21315047d1725ad4494d15b8ba. It seems to make tests fail... let me fix this later.
2019-04-26Class instance should be also colorable on IRBTakashi Kokubun
inspect. Change is made with: `$ make -C .ruby sync-default-gems GEM=irb`
2019-04-26make sync-default-gems GEM=irbTakashi Kokubun
from https://github.com/ruby/irb/commit/e6739d8c66dc78562930adb0b96935c9b38acf74
2019-04-26Syntax-highlight yield in IRBTakashi Kokubun
2019-04-26Support highlighting Regexp in inspectTakashi Kokubun
2019-04-26Force IRB::Color to recognize TERMTakashi Kokubun
Closes: https://github.com/ruby/ruby/pull/2150
2019-04-26Colorize IRB's inspect resultTakashi Kokubun
Closes: https://github.com/ruby/ruby/pull/2150
2019-04-26Colorize IRB's code_around_bindingTakashi Kokubun
Closes: https://github.com/ruby/ruby/pull/2150
2019-04-21Remove unused variable and check if successednobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21suppress warning in test/irbnaruse
https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos7/ruby-trunk/log/20190421T040003Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Remove IRB's old test filesaycabta
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Suppress read of ~/.irbrckazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12irb.rb: update `_`nobu
* lib/irb.rb (IRB::Irb#eval_input): update `_` after exception. [ruby-core:86989] [Bug #14749] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12fix TestInputMethodnobu
* test/irb/test_context.rb (TestInputMethod#initialize): fix typos and increment `line_no` only when not reaching the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-14irb.rb: restore the last errornobu
* lib/irb.rb (eval_input): restore the last error `$!`, as the previous result. [Feature #14684] * lib/irb/context.rb (evaluate): add `exception` keyword argument to set the last error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-14irb/{context,workspace}.rb: use local_variable_setnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-10skip some tests so that no failure occurs in root privilegemame
Some tests had failed on `sudo make test-all`, mainly because root can access any files regardless of permission. This change adds `skip` guards into such tests. Note that almost all tests in which `skip` guards is added, already have "windows" guard. This is because there is no support to avoid read access by owner on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12irb/test_init.rb: add test to ensure $0k0kubun
is not changed. At first `ARGV.unshift('something')` was suggested for r61149, but it wasn't sufficient because it modifies $0. Not only to preserve ARGV, but also r61149 intends to preserve $0. This test prevents future breakage of the behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12irb.rb: preserve ARGV on binding.irbk0kubun
This is not perfectly good solution (at least we don't want to have ARGV as default value of `argv` argument), but unfortunately IRB.setup and IRB.parse_opts are public methods and we can't make breaking change to those methods. We may deprecate using them and then make them private in the future, but the removal should not be in Ruby 2.5. So I kept their interface for now. [Bug #14162] [close GH-1770] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29test_workspace.rb: prefer using skipk0kubun
rather than ignoring test definition to know untestability when executing test with `-v`. Also this simplifies check using `MiniTest::Unit::Guard#windows?`. This change is suggested by @MSP-Greg here: https://github.com/ruby/ruby/commit/7128849c8c5fce8df450379db54136fd21fab6ad#commitcomment-25836745 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24test_workspace.rb: skip test failing on windowsk0kubun
> Note that all files are always readable > https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/chmod-wchmod It seems that we can't make a file unreadable with `File.chmod` on Windows. When file can't be read, File::EACCES is raised on Windows too. So r60900 should work anyway, but I don't know how to let it happen by Ruby code. I tried to open file before reading it, but I couldn't reproduce File::EACCES too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24Fix TOCTTOU and avoid to read existing unreadable filekazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24Fix typos [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24test/irb/test_workspace.rb: fix SCRIPT_LINES__nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24irb.rb: show source around binding.irb on startk0kubun
[Feature #14124] [ruby-dev:50319] [close GH-1764] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20ruby-lex.rb: fix continued line conditionsnobu
* lib/irb/ruby-lex.rb (RubyLex#lex): fix conditions for continued line; empty lines, a semicolon, first line in `begin` block, just after `else` are not continued. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30refine assertionsnobu
* test/irb/test_ruby-lex.rb (test_prompt): invert confinue flag by FIXME comments. adjust line numbers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30more checks for promptnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30test for promptnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e