aboutsummaryrefslogtreecommitdiffstats
path: root/test/reline
Commit message (Collapse)AuthorAgeFilesLines
* Add test/reline/test_string_processing.rbaycabta2019-11-211-0/+23
|
* Change argument `Proc` to `#call` defined object.manga_osyo2019-11-211-0/+24
| | | | This is the same as the behavior of Readline.
* Prefer dedecated assertionsNobuyoshi Nakada2019-11-191-4/+4
|
* Implement em_set_mark and em_exchange_markaycabta2019-11-152-0/+36
|
* Fixed `assert_equal` first argument to be expected.manga_osyo2019-11-121-4/+4
|
* Reline#readline and Reline#readmultiline to private.osyo-manga2019-11-121-2/+6
|
* Swap expected and actual correctlyaycabta2019-10-071-50/+50
|
* Make rb_scan_args handle keywords more similar to Ruby methods (#2460)Jeremy Evans2019-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cfuncs that use rb_scan_args with the : entry suffer similar keyword argument separation issues that Ruby methods suffer if the cfuncs accept optional or variable arguments. This makes the following changes to : handling. * Treats as **kw, prompting keyword argument separation warnings if called with a positional hash. * Do not look for an option hash if empty keywords are provided. For backwards compatibility, treat an empty keyword splat as a empty mandatory positional hash argument, but emit a a warning, as this behavior will be removed in Ruby 3. The argument number check needs to be moved lower so it can correctly handle an empty positional argument being added. * If the last argument is nil and it is necessary to treat it as an option hash in order to make sure all arguments are processed, continue to treat the last argument as the option hash. Emit a warning in this case, as this behavior will be removed in Ruby 3. * If splitting the keyword hash into two hashes, issue a warning, as we will not be splitting hashes in Ruby 3. * If the keyword argument is required to fill a mandatory positional argument, continue to do so, but emit a warning as this behavior will be going away in Ruby 3. * If keyword arguments are provided and the last argument is not a hash, that indicates something wrong. This can happen if a cfunc is calling rb_scan_args multiple times, and providing arguments that were not passed to it from Ruby. Callers need to switch to the new rb_scan_args_kw function, which allows passing of whether keywords were provided. This commit fixes all warnings caused by the changes above. It switches some function calls to *_kw versions with appropriate kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS is used. If creating new arguments, RB_PASS_KEYWORDS is used if the last argument is a hash to be treated as keywords. In open_key_args in io.c, use rb_scan_args_kw. In this case, the arguments provided come from another C function, not Ruby. The last argument may or may not be a hash, so we can't set keyword argument mode. However, if it is a hash, we don't want to warn when treating it as keywords. In Ruby files, make sure to appropriately use keyword splats or literal keywords when calling Cfuncs that now issue keyword argument separation warnings through rb_scan_args. Also, make sure not to pass nil in place of an option hash. Work around Kernel#warn warnings due to problems in the Rubygems override of the method. There is an open pull request to fix these issues in Rubygems, but part of the Rubygems tests for their override fail on ruby-head due to rb_scan_args not recognizing empty keyword splats, which this commit fixes. Implementation wise, adding rb_scan_args_kw is kind of a pain, because rb_scan_args takes a variable number of arguments. In order to not duplicate all the code, the function internals need to be split into two functions taking a va_list, and to avoid passing in a ton of arguments, a single struct argument is used to handle the variables previously local to the function.
* Add test with encoding.manga_osyo2019-08-271-10/+10
|
* Change to test file path.manga_osyo2019-08-271-0/+242
|
* Refactoring Reline.manga_osyo2019-08-271-3/+6
|
* Fix reference core method.manga_osyo2019-08-271-2/+2
|
* Remove test_mode in `lib/reline`.manga_osyo2019-08-271-0/+12
|
* Remove commented out debug printaycabta2019-08-181-4/+0
|
* Don't crash when deleting at the end of the lineAlan Wu2019-08-181-0/+10
| | | | | To reproduce this bug, type one character into irb, then press the delete key on your keyboard.
* Move a test file of Reline to test/reline/aycabta2019-07-151-0/+273
|
* Remove unused method.manga_osyo2019-07-151-1/+1
|
* Support Control- and Meta-aycabta2019-07-041-0/+2
|
* Check commented out line in inputrc correctlyaycabta2019-07-041-0/+22
|
* Parse key sequence more strictlyNobuyoshi Nakada2019-07-041-0/+5
|
* Skip indented comment lines [Bug #15981]Nobuyoshi Nakada2019-07-041-0/+5
|
* Remove unnecessary variablesaycabta2019-06-081-1/+0
|
* Skip transpose-words if less than 2 wordaycabta2019-06-061-0/+76
|
* Add test_ed_transpose_words_for_mbcharaycabta2019-06-061-0/+42
|
* Renamed duplicate testNobuyoshi Nakada2019-06-041-1/+1
|
* Add aliases for commands for changing text macroaycabta2019-06-041-0/+14
|
* Implement transpose-wordsaycabta2019-06-041-0/+42
|
* Use lines instead of splitKazuhiro NISHIYAMA2019-06-031-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` % cat ~/bench-split.yml prelude: | s = "foo\nbar\nbaz\n" benchmark: '/(?<=\n)/': | s.split(/(?<=\n)/) '/^/': | s.split(/^/) 'lines': | s.lines Warming up -------------------------------------- /(?<=\n)/ 459.123k i/s - 467.844k times in 1.018994s (2.18μs/i) /^/ 467.922k i/s - 469.744k times in 1.003894s (2.14μs/i) lines 2.343M i/s - 2.424M times in 1.034677s (426.84ns/i) Calculating ------------------------------------- /(?<=\n)/ 422.347k i/s - 1.377M times in 3.261232s (2.37μs/i) /^/ 477.603k i/s - 1.404M times in 2.939186s (2.09μs/i) lines 2.485M i/s - 7.028M times in 2.828757s (402.47ns/i) Comparison: lines: 2484631.6 i/s /^/: 477603.3 i/s - 5.20x slower /(?<=\n)/: 422346.5 i/s - 5.88x slower ```
* The C-q is also quoted insert in emacs modeaycabta2019-06-031-0/+13
|
* Add aliases for commands for moving macroaycabta2019-06-031-0/+11
|
* Close leaked file descripters in testsaycabta2019-06-032-1/+7
|
* The ed_move_to_beg is different from vi_first_printaycabta2019-06-032-1/+29
|
* Fix ArgumentError in aliased macroNobuyoshi Nakada2019-06-031-0/+34
| | | | Closes: https://github.com/ruby/ruby/pull/2221
* Check conditional nestings in INPUTRCNobuyoshi Nakada2019-06-021-0/+27
| | | | Closes: https://github.com/ruby/ruby/pull/2222
* Use simpler regexpKazuhiro NISHIYAMA2019-06-021-6/+6
|
* Add true condition `Reline`Nobuyoshi Nakada2019-06-021-10/+12
|
* Add Reline test for unknown macroaycabta2019-06-021-0/+6
|
* Add new test for Reline within pipeaycabta2019-06-021-0/+24
|
* Reset Config at Reline::Config::Test#teardownaycabta2019-06-011-0/+1
|
* Use inputrc data for keystroke settingaycabta2019-06-012-25/+35
|
* Remove extra items because Reline::HISTORY is a sized queueaycabta2019-05-291-0/+28
|
* Revert 3b7862c8e88cd7838a53ec083ac5733386400956 causing various CI hangsTakashi Kokubun2019-05-292-33/+5
| | | | | | | | | | | | | | | | | | | | | and dependent commits c67934b1c3b40dda5f170b032423e520511c68dd and f0d1dc5cee87dfb023cb43a2db9bcdef5a8dee8f. RubyCI and ci.rvm.jp are almost dead by timeout since this commit. --- Revert "Skip a reline test hanging on Wercker since 3b7862c8e8" This reverts commit f0d1dc5cee87dfb023cb43a2db9bcdef5a8dee8f. Revert "Remove extra items because Reline::HISTORY is a sized queue" This reverts commit c67934b1c3b40dda5f170b032423e520511c68dd. Revert "Use existing instances for LineEditor and Config" This reverts commit 3b7862c8e88cd7838a53ec083ac5733386400956.
* Remove extra items because Reline::HISTORY is a sized queueaycabta2019-05-291-0/+27
|
* Use existing instances for LineEditor and Configaycabta2019-05-292-5/+6
|
* Use Reline.completer_quote_characters to completeaycabta2019-05-282-2/+0
|
* Support Meta key in Relineaycabta2019-05-242-34/+20
|
* Use Reline.test_mode in Reline's test tooaycabta2019-05-222-0/+2
|
* Support DEL keyaycabta2019-05-211-0/+25
|
* Rename Reline's test file name because of typoaycabta2019-05-141-0/+0
|
* Check encoding when Readline completionaycabta2019-05-141-1/+6
|