summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
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-01Add exception support in `Range#first`.manga_osyo
Closes: https://github.com/ruby/ruby/pull/2163
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-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-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-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-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-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-23Disallow numbered parameter as the default value of optional argumentSeiei Miyagi
[Fix GH-2139] [Bug #15783]
2019-04-23Fix internal error of `->x:@2{}`Seiei Miyagi
[Fix GH-2139] [Bug #15783]
2019-04-21test/ruby/test_pattern_matching.rb: add missing tests for NODE_DASGN, NODE_LASGNktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21Add missing test for p_var_refktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21Add missing tests for p_argsktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20skip test until we can guarantee movement of certain objectstenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20skip test if mjit is enabledtenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Workaround Wercker check which is not working nowk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Skip test_find_collided_object on problematic CIs for nowk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Add `Time#floor`nobu
[Feature #15653] [Fix GH-2092] From: manga_osyo <manga.osyo@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20add more assertions around moved objecttenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20check the index rather than includetenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Try harder to make objects movetenderlove
Sometimes the objects we allocated may not get compacted. This change is to increase the likelyhood that they will move git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Add `GC.compact` again.tenderlove
🙏 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-19time.c: added in: option to Time.nownobu
* time.c (time_s_now): added in: option to Time.now as well as Time.at. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-18io.c: warn non-nil $,nobu
* array.c (rb_ary_join_m): warn use of non-nil $,. * io.c (rb_output_fs_setter): warn when set to non-nil value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-18Suppress warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-18string.c: warn non-nil $;nobu
* string.c (rb_str_split_m): warn use of non-nil $;. * string.c (rb_fs_setter): warn when set to non-nil value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Reverting compaction for nowtenderlove
For some reason symbols (or classes) are being overridden in trunk git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Suppress warning in assertion tookazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Suppress warnings in `make test-all`kazu
suppress "warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Define Struct#deconstructktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Introduce pattern matching [EXPERIMENTAL]ktsj
[ruby-core:87945] [Feature #14912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17call verification method in addition to compactiontenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Adding `GC.compact` and compacting GC support.tenderlove
This commit adds the new method `GC.compact` and compacting GC support. Please see this issue for caveats: https://bugs.ruby-lang.org/issues/15626 [Feature #15626] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Prefer uintptr_t over ptrdiff_t for i686k0kubun
as debugged in PR [close https://github.com/ruby/ruby/pull/2130] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Revert "Try to set false explicitly"k0kubun
This reverts commit a1b5d20068a9b1859b383b249e510cd33d196e4a. Revert "Revert "Skip recompiling tests on i686 Linux"" This reverts commit 7b88a9207b97b94bc3c3be35084c742296f4aff2. Revert "Simplify matrix for debugging" This reverts commit e85d6c5c5e62dde37c6f6ffdb7125b9008b9ebfa. Sorry, these 3 commits were under debugging in https://github.com/ruby/ruby/pull/2129 but accidentally merged by using `git svn dcommit` instead of `git push` to the topic branch :bow: git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Revert "Skip recompiling tests on i686 Linux"k0kubun
This reverts commit 19513c88d5f923abb7f226520192aef9f3fcc1c7. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Fix typo in platform matcherk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Skip recompiling tests on i686 Linuxk0kubun
somehow they are filing like https://travis-ci.org/ruby/ruby/jobs/519830085 but they are not so fatal. Let me just skip them for now and fix tests afterwards. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Recompile JIT-ed code without optimizationk0kubun
based on inline cache when JIT cancel happens by that. This feature was in the original MJIT implementation by Vladimir, but on merging MJIT to Ruby it was removed for simplification. This commit adds the functionality again for the following benchmark: https://github.com/benchmark-driver/misc/blob/52f05781f65467baf895bf6ba79d172c9b0826fd/concurrent-map/bench.rb (shown float is duration seconds. shorter is better) * Before ``` $ INHERIT=0 ruby -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) [x86_64-linux] -- 1.6507579649914987 $ INHERIT=0 ruby -v --jit bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) +JIT [x86_64-linux] -- 1.5091587850474752 $ INHERIT=1 ruby -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) [x86_64-linux] -- 1.6124781150138006 $ INHERIT=1 ruby --jit -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) +JIT [x86_64-linux] -- 1.7495657080435194 # <-- this ``` * After ``` $ INHERIT=0 ruby -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) [x86_64-linux] last_commit=Recompile JIT-ed code without optimization -- 1.653559010999743 $ INHERIT=0 ruby --jit -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) +JIT [x86_64-linux] last_commit=Recompile JIT-ed code without optimization -- 1.4738391840364784 $ INHERIT=1 ruby -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) [x86_64-linux] last_commit=Recompile JIT-ed code without optimization -- 1.645227018976584 $ INHERIT=1 ruby --jit -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) +JIT [x86_64-linux] last_commit=Recompile JIT-ed code without optimization -- 1.523708809982054 # <-- this ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10Reverting all commits from r67479 to r67496 because of CI failureskazu
Because hard to specify commits related to r67479 only. So please commit again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09Don't fail the build if we can't get objects to movetenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09Try to make compaction more likelytenderlove
This commit tries to make compaction more likely by allocating some objects and then throwing them away git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09Adding `GC.compact` and compacting GC support.tenderlove
This commit adds the new method `GC.compact` and compacting GC support. Please see this issue for caveats: https://bugs.ruby-lang.org/issues/15626 [Feature #15626] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e