aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
Commit message (Collapse)AuthorAgeFilesLines
* test/lib/envutil.rb (EnvUtil.timeout): added.Yusuke Endoh2019-05-261-3/+2
| | | | It is a wrapper for Timeout.timeout with the scale factor applied.
* Fix scanner event at invalid syntaxNobuyoshi Nakada2019-05-261-3/+6
| | | | | | * parse.y (parser_yyerror, parser_compile_error): revert r67224 (e5d10cda07b23682e5e4e64d1324e4d3247d4785) "Flush erred token".
* test/ruby/test_rubyoptions.rb (test_script_from_stdin): scale timeoutYusuke Endoh2019-05-261-1/+2
| | | | | | for Solaris. https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20190525T131909Z.fail.html.gz
* Avoid to show warning message with unused variable.Hiroshi SHIBATA2019-05-251-2/+2
|
* Mixed encoding error can continue to parseNobuyoshi Nakada2019-05-242-4/+14
|
* test/ruby/test_gc.rb (test_gc_stress_at_startup): extend time timeoutYusuke Endoh2019-05-241-1/+1
| | | | | | It fails on some CI environments. https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian8/ruby-trunk/log/20190524T003006Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20190523T002505Z.fail.html.gz
* Test GC.compact with MJIT againTakashi Kokubun2019-05-231-3/+1
|
* Add `Time#ceil`.manga_osyo2019-05-231-0/+26
| | | | Closes: https://github.com/ruby/ruby/pull/2133
* Adding Enumerable#filter_mapAlfonso Jiménez2019-05-232-1/+11
| | | | | [Feature #15323] Closes: https://github.com/ruby/ruby/pull/2017
* Fix mixed encoding in heredocJeremy Evans2019-05-221-0/+29
| | | | | | | | | Heredocs are parsed line-by-line, so we need to keep track of the temporary encoding of the string. Previously, a heredoc would only detect mixed encoding errors if they were on the same line, this changes things so they will be caught on different lines. Fixes [Bug #15839]
* Do not kick finalizers on rb_gc().Koichi Sasada2019-05-231-2/+0
| | | | | | | | | | | | | | | | rb_gc() kicks gc_finalize_deferred(), which invokes finalizers. This means that any Ruby program can be run this point and it may be thread switching points and so on. However, it is difficult to think it invokes any Ruby programs. For example, `GC.compact` use `rb_gc()` to implement it, howver, any Ruby program must not be run on this timing. For this reason (it is difficult to image it run any Ruby program), I removed `gc_finalize_deferred()` line in rb_gc(). This patch solves GC.compact issue. [Bug #15809] and re-enable GC.compact test.
* range.c (inspect_range): omit beginless "nil"Yusuke Endoh2019-05-231-0/+4
| | | | | | | | | | | | except the special case `(nil..nil)`. ``` (1..).inspect #=> "1.." (..5).inspect #=> "..5" (nil..nil).inspect #=> "nil..nil" ``` [Bug #15745]
* hash.c (rb_hash_s_create): Reject `Hash[[nil]]`Yusuke Endoh2019-05-231-6/+5
| | | | | | | The behavior of `Hash[[nil]] #=> {}` was a bug until 1.9.3, but had been remained with a warning because some programs depended upon it. Now, six years passed. We can remove the compatibility behavior. [Bug #7300]
* re-skip tests of GC.compact.Koichi Sasada2019-05-211-0/+2
|
* enable test for GC.compact to reproduce an issue on CIKoichi Sasada2019-05-211-2/+0
|
* Do not modify shared arrayNobuyoshi Nakada2019-05-211-1/+0
| | | | [Bug #15821]
* Simplified the guard against old versionsNobuyoshi Nakada2019-05-211-5/+2
|
* skip a test to pass CIs.Koichi Sasada2019-05-181-0/+1
| | | | | I'm debugging [Bug #15821] but my patch introduces another issue. So I simply skip this test and re-enable it later.
* Add test for UNTILNobuyoshi Nakada2019-05-181-0/+12
|
* Distinguish pre-condition and post-condition loopsNobuyoshi Nakada2019-05-181-0/+12
|
* skip tests for GC.compact to pass CI.Koichi Sasada2019-05-171-0/+2
| | | | | Now, GC.compact has issues which makes rubyci RED, so I skip this test and debug soon.
* Test to disable ASCII-only optimizationNobuyoshi Nakada2019-05-171-0/+10
| | | | | | | Examples why ASCII-only optimization cannot apply multi-byte encodings which have 7-bit trailing bytes. Suggested by @duerst at https://github.com/ruby/ruby/pull/2187#issuecomment-492949218
* Add object packing strategies for compactionAaron Patterson2019-05-141-3/+4
| | | | | | | | This commit adds an alternative packing strategy for compaction. Instead of packing towards "most pinned" pages, we can pack towards "most empty" pages. The idea is that we can double the heap size, then pack all objects towards the empty side of the heap. This will ensure maximum chaos for testing / verification.
* Avoid triggering autoload in Module#const_defined?(String)Jean Boussier2019-05-071-0/+6
| | | | [Bug #15780]
* Fix use of numbered parameter inside proc that is default value of optargJeremy Evans2019-05-051-0/+2
| | | | | | | | | | | | | | | | 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]
* Fix a case where numbered parameters should not be allowedJeremy Evans2019-05-051-0/+2
| | | | | | | | | | | | | | | | | | 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]
* parse.y: duplicated when clause warningNobuyoshi Nakada2019-05-051-3/+14
| | | | | * parse.y (case_args): moved "duplicated when clause" warning from compile phase, so that `ruby -wc` shows them.
* Add exception support in `Range#first`.manga_osyo2019-05-011-0/+2
| | | | Closes: https://github.com/ruby/ruby/pull/2163
* Disallow also CR in here-doc identifierNobuyoshi Nakada2019-04-291-0/+6
| | | | | | * 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.
* parse.y: fix here-doc identifier with newlineNobuyoshi Nakada2019-04-291-4/+3
| | | | | | | | | | | | | | | * 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 ```
* numeric.c: Extend Integer#[] to support range argumentsYusuke Endoh2019-04-281-0/+25
| | | | | | | | | | | ```` 0b01001101[2, 4] #=> 0b0011 0b01001100[2..5] #=> 0b0011 0b01001100[2...6] #=> 0b0011 ^^^^ ```` [Feature #8842]
* test/ruby/test_integer.rb: Add a sane test for Integer#[]Yusuke Endoh2019-04-281-0/+14
|
* Always mark the string returned by File.realpath as taintedJeremy Evans2019-04-281-1/+1
| | | | | | | | | | | | | | | | | 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]
* Get rid of indirect sharingNobuyoshi Nakada2019-04-271-0/+9
| | | | | | | | | * 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]
* Hide internal IDsNobuyoshi Nakada2019-04-262-0/+8
| | | | | | | | * 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]
* Fix typos [ci skip]Kazuhiro NISHIYAMA2019-04-251-7/+7
|
* Defer setting gc_stress until inits doneNobuyoshi Nakada2019-04-241-0/+4
| | | | [Bug #15784]
* Fix complex hash keys to work with compactionAaron Patterson2019-04-231-0/+7
| | | | | | | | | 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
* Disallow numbered parameter as the default value of optional argumentSeiei Miyagi2019-04-231-0/+1
| | | | [Fix GH-2139] [Bug #15783]
* Fix internal error of `->x:@2{}`Seiei Miyagi2019-04-231-0/+1
| | | | [Fix GH-2139] [Bug #15783]
* test/ruby/test_pattern_matching.rb: add missing tests for NODE_DASGN, NODE_LASGNktsj2019-04-211-0/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add missing test for p_var_refktsj2019-04-211-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add missing tests for p_argsktsj2019-04-211-0/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* skip test until we can guarantee movement of certain objectstenderlove2019-04-201-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* skip test if mjit is enabledtenderlove2019-04-201-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Workaround Wercker check which is not working nowk0kubun2019-04-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Skip test_find_collided_object on problematic CIs for nowk0kubun2019-04-201-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add `Time#floor`nobu2019-04-201-0/+26
| | | | | | | | | [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
* add more assertions around moved objecttenderlove2019-04-201-1/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* check the index rather than includetenderlove2019-04-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e