summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2019-05-10Adjust indentNobuyoshi Nakada
2019-05-10Add one more retry for win32ole event matcherTakashi Kokubun
to fix https://ci.appveyor.com/project/ruby/ruby/builds/24438615/job/yld1utsltxag9dr2
2019-05-09str_duplicate: Don't share with a frozen shared stringAlan Wu
This is a follow up for 3f9562015e651735bfc2fdd14e8f6963b673e22a. Before this commit, it was possible to create a shared string which shares with another shared string by passing a frozen shared string to `str_duplicate`. Such string looks like: ``` -------- ----------------- | root | ------ owns -----> | root's buffer | -------- ----------------- ^ ^ ^ ----------- | | | shared1 | ------ references ----- | ----------- | ^ | ----------- | | shared2 | ------ references --------- ----------- ``` This is bad news because `rb_fstring(shared2)` can make `shared1` independent, which severs the reference from `shared1` to `root`: ```c /* from fstr_update_callback() */ str = str_new_frozen(rb_cString, shared2); /* can return shared1 */ if (STR_SHARED_P(str)) { /* shared1 is also a shared string */ str_make_independent(str); /* no frozen check */ } ``` If `shared1` was the only reference to `root`, then `root` can be reclaimed by the GC, leaving `shared2` in a corrupted state: ``` ----------- -------------------- | shared1 | -------- owns --------> | shared1's buffer | ----------- -------------------- ^ | ----------- ------------------------- | shared2 | ------ references ----> | root's buffer (freed) | ----------- ------------------------- ``` Here is a reproduction script for the situation this commit fixes. ```ruby a = ('a' * 24).strip.freeze.strip -a p a 4.times { GC.start } p a ``` - string.c (str_duplicate): always share with the root string when the original is a shared string. - test_rb_str_dup.rb: specifically test `rb_str_dup` to make sure it does not try to share with a shared string. [Bug #15792] Closes: https://github.com/ruby/ruby/pull/2159
2019-05-09require 'stringio'NARUSE, Yui
2019-05-08Trim MJIT output from TestHideSkipTakashi Kokubun
to prevent failure like https://app.wercker.com/ruby/ruby/runs/mjit-test1/5cd28aa6ab79a30008ee819b?step=5cd28b2403f44600070db083 with --jit-verbose=1.
2019-05-07Avoid triggering autoload in Module#const_defined?(String)Jean Boussier
[Bug #15780]
2019-05-05Fix use of numbered parameter inside proc that is default value of optargJeremy Evans
This allows cases such as: ```ruby m ->(a = ->{@1}) {a} m.call.call(1) m2 ->(a: ->{@1}) {a} m2.call.call(2) ``` Previously, this would cause a syntax error. [Bug#15789]
2019-05-05Fix a case where numbered parameters should not be allowedJeremy Evans
Because `proc{|| @1}` is a syntax error, the following should also be syntax errors: ```ruby proc { | | @1} ``` ```ruby proc { |; a| @1 } ``` This fixes both cases. [Bug #15825]
2019-05-05parse.y: duplicated when clause warningNobuyoshi Nakada
* parse.y (case_args): moved "duplicated when clause" warning from compile phase, so that `ruby -wc` shows them.
2019-05-04ignore test_RangeErrorMasatoshi SEKI
2019-05-04add DRb::WeakIdConv (Bug #15711)Masatoshi SEKI
2019-05-01Silence a (probable) debug printNobuyoshi Nakada
2019-05-01Windows simply causes an error to open invalid pathNAKAMURA Usaku
2019-05-01Add exception support in `Range#first`.manga_osyo
Closes: https://github.com/ruby/ruby/pull/2163
2019-04-30Skip on Windows now when using reline because it causes hang of whole testsNAKAMURA Usaku
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-30Use Encoding::UTF_8 if RELINE_TEST_ENCODING doesn't existaycabta
2019-04-30Use Encoding::UTF_8 if Encoding.default_external is Encoding::IBM437aycabta
2019-04-30Add Reline as a fallback library for Readlineaycabta
* lib/reine.rb, lib/reline/*: Reline is a readline stdlib compatible library. * lib/readline.rb: Readline uses a fallback to Reline when ext/readline doesn't exist. * tool/sync_default_gems.rb: add ruby/reline as a default gem. * appveyor.yml: add "set RELINE_TEST_ENCODING=Windows-31J" for test suit of Reline, and add "--exclude readline" to "nmake test-all" on Visual Studio builds because of strange behavior. * spec/ruby/library/readline/spec_helper.rb: skip Reline as with RbReadline.
2019-04-29Disallow also CR in here-doc identifierNobuyoshi Nakada
* parse.y (heredoc_identifier): CR in here-document identifier might or might not result in a syntax error, by the EOL code. make a syntax error regardless of the EOL code.
2019-04-29Make only `mesg` can be assigned with default `fname`Nobuyoshi Nakada
2019-04-29parse.y: fix here-doc identifier with newlineNobuyoshi Nakada
* parse.y (heredoc_identifier): quoted here-document identifier must end within the same line. the only corner case that here-document identifier can contain a newline is that the closing qoute is placed at the beginning of the next line, and has been warned since 2.4. ```ruby <<"EOS " # warning: here document identifier ends with a newline EOS ```
2019-04-28numeric.c: Extend Integer#[] to support range argumentsYusuke Endoh
```` 0b01001101[2, 4] #=> 0b0011 0b01001100[2..5] #=> 0b0011 0b01001100[2...6] #=> 0b0011 ^^^^ ```` [Feature #8842]
2019-04-28test/ruby/test_integer.rb: Add a sane test for Integer#[]Yusuke Endoh
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-28Update rubygems with latest upstream changesDavid Rodríguez
Closes: https://github.com/ruby/ruby/pull/2154
2019-04-28Always mark the string returned by File.realpath as taintedJeremy Evans
This string can include elements that were not in either string passed to File.realpath, even if one of the strings is an absolute path, due to symlinks: ```ruby Dir.mkdir('b') unless File.directory?('b') File.write('b/a', '') unless File.file?('b/a') File.symlink('b', 'c') unless File.symlink?('c') path = File.realpath('c/a'.untaint, Dir.pwd.untaint) path # "/home/testr/ruby/b/a" path.tainted? # should be true, as 'b' comes from file system ``` [Bug #15803]
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-27Get rid of indirect sharingNobuyoshi Nakada
* string.c (str_duplicate): share the root shared string if the original string is already sharing, so that all shared strings refer the root shared string directly. indirect sharing can cause a dangling pointer. [Bug #15792]
2019-04-27Isolate TestGCCompact from JIT testingTakashi Kokubun
Wercker seems to randomly fail https://app.wercker.com/ruby/ruby/runs/mjit-test1/5cc3c1c423fcb70008db9b64?step=5cc3c46a03f4460007da0659 To help debugging, let me isolate the impact from GC.compact in the JIT testing on Wercker.
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-26Hide internal IDsNobuyoshi Nakada
* parse.y (internal_id): number the ID serial for internal use by counting down from the neary maximum value, not to accidentally match permanent IDs. [Bug #15768] Notes: Fixed: [Bug #15786]
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-25add DRbObject dereference test (Preparation for investigation of Bug #15711)Masatoshi SEKI
2019-04-25Fix typos [ci skip]Kazuhiro NISHIYAMA
2019-04-24Defer setting gc_stress until inits doneNobuyoshi Nakada
[Bug #15784]
2019-04-23Fix complex hash keys to work with compactionAaron Patterson
For example when an array containing objects is a hash key, the contents of the array may move which can cause the hash value for the array to change. This commit makes the default `hash` value based off the object id, so the hash value will remain stable. Fixes test/shell/test_command_processor.rb
2019-04-23Revert "IRB is improved with Reline and RDoc, take 2"Nobuyoshi Nakada
Accidentally merged when 89271d4a3733bc5e70e9c56b4bd12f277e699c42 "Adjusted indents".