summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2019-08-09Fix parsing of mutiple assignment with rescue modifierJeremy Evans
Single assignment with rescue modifier applies rescue to the RHS: a = raise rescue 1 # a = (raise rescue 1) Previously, multiple assignment with rescue modifier applied rescue to the entire expression: a, b = raise rescue [1, 2] # (a, b = raise) rescue [1, 2] This makes multiple assignment with rescue modifier consistent with single assignment with rescue modifier, applying rescue to the RHS: a, b = raise rescue [1, 2] # a, b = (raise rescue [1, 2]) Implements [Feature #8239] Fixes [Bug #8279]
2019-08-09restore timeoutKoichi Sasada
2019-08-09extend timeout to debug.Koichi Sasada
2019-08-09introduce RCLASS_CLONED flag for inline cache.Koichi Sasada
Methods on duplicated class/module refer same constant inline cache (IC). Constant access lookup should be done for cloned class/modules but inline cache doesn't check it. To check it, this patch introduce new RCLASS_CLONED flag which are set when if class/module is cloned (both orig and dst). [Bug #15877]
2019-08-09Iseq#to_binary: Add support for NoMatchingPatternError and TypeErrorAlan Wu
Binary dumping the iseq for `case foo in []; end` used to crash as there was no handling for these exception classes. Pattern matching generates these classes as operands to `putobject`. [Bug #16088] Closes: https://github.com/ruby/ruby/pull/2325
2019-08-09Should require without wrapper moduleNobuyoshi Nakada
2019-08-08Reduce unnecessary EXEC_TAG in requireNobuyoshi Nakada
2019-08-08solve "duplicate :raise event" in require too [Bug #15877]Nobuyoshi Nakada
2019-08-08solve "duplicate :raise event" [Bug #15877]Koichi Sasada
Without this patch, "raise" event invoked twice when raise an exception in "load"ed script. This patch by danielwaterworth (Daniel Waterworth). [Bug #15877]
2019-08-06Removing duplicated assertions on test_array.rb - MINUS methodEspartaco Palma
Closes: https://github.com/ruby/ruby/pull/1790
2019-08-06Give up stabilizing TestProcess on Travis osxTakashi Kokubun
They have been too unstable. Revert "Extend sleep before sending USR1 in TestProcess" This reverts commit aaf69a8ba866193863a7eafe5c6044844bd71bc3. Revert "Extend sleep before sending USR1 in TestProcess" This reverts commit 076f3fcf11a061394d3d5f8c671512df1e983023.
2019-08-05Check if signaledNobuyoshi Nakada
2019-08-05Refined assertion messagesNobuyoshi Nakada
2019-08-05Fixed assertionNobuyoshi Nakada
The regexp should be expected to match the error message.
2019-08-04Extend sleep before sending USR1 in TestProcessTakashi Kokubun
just like 076f3fcf11a061394d3d5f8c671512df1e983023. This test also hanged on Travis osx https://travis-ci.org/ruby/ruby/jobs/567547060
2019-08-04Revert "Skip test_race_exception on MJIT for now"Takashi Kokubun
This reverts commit 7a75baa6e294473f02da512c99f7ef1f76b2d83c. Revert "Defer skip to avoid errors on ensure" This reverts commit adfc8d6dbadbccef27d6ec78022650840c7604cc. because 76e2370f132f83c16c9de39a0a9356579f364527 is hoped to fix the problem.
2019-08-04Defer skip to avoid errors on ensureTakashi Kokubun
2019-08-04Skip test_race_exception on MJIT for nowTakashi Kokubun
somehow the test fails only on Wercker in CIs triggered by GitHub. Actually rubyci and ci.rvm.jp also have issues too, though.
2019-08-03Fix dangling path name from fstringNobuyoshi Nakada
* parse.y (yycompile): make sure in advance that the `__FILE__` object shares a fstring, to get rid of dangling path name. Fixed up 53e9908d8afc7f03109b0aafd1698ab35f512b05. [Bug #16041] * vm_eval.c (eval_make_iseq): ditto.
2019-08-02Revert "Remove opt_nil_p test to remove warning for now"Yusuke Endoh
This reverts commit a1727e43af18c122c4d7adfa603f895fdc8f3df1.
2019-08-02Remove opt_nil_p test to remove warning for nowTakashi Kokubun
2019-08-02Fix uplevelNobuyoshi Nakada
2019-08-01Make attr* methods define public methods if self in caller is not same as ↵Jeremy Evans
receiver Previously, attr* methods could be private even if not in the private section of a class/module block. This uses the same approach that ruby started using for define_method in 1fc33199736f316dd71d0c551edbf514528ddde6. Fixes [Bug #4537]
2019-08-01Extend sleep before sending USR1 in TestProcessTakashi Kokubun
because the test seems to hang there forever: https://travis-ci.org/ruby/ruby/jobs/566409880
2019-08-01Add a test for opt_nil_pTakashi Kokubun
2019-08-01Compact ensure clause and rename variables to fix alignmentKazuhiro NISHIYAMA
2019-08-01check hash_hint is different.Koichi Sasada
2019-07-31test/ruby/test_hash.rb: remove a unused vribleYusuke Endoh
to suppress a warning
2019-07-31check SystemStackErrorKoichi Sasada
This recursive iteration test can cause SystemStackError so check it correctly.
2019-07-31test/ruby/test_float.rb: suppress an overflow warningYusuke Endoh
``` warning: Float 0xf.fp10000000000000... out of range ```
2019-07-31test/ruby/test_io.rb (test_binmode_pipe): close all pipes explicitlyYusuke Endoh
to suppress the leak checker.
2019-07-31test/ruby/test_file_exhaustive.rb: suppress method-redefined warningYusuke Endoh
2019-07-31remove RHash::iter_lev.Koichi Sasada
iter_lev is used to detect the hash is iterating or not. Usually, iter_lev should be very small number (1 or 2) so `int` is overkill. This patch introduce iter_lev in flags (7 bits, FL13 to FL19) and if iter_lev exceeds this range, save it in hidden attribute. We can get 1 word in RHash. We can't modify frozen objects. Therefore I added new internal API `rb_ivar_set_internal()` which allows us to set an attribute even if the target object is frozen if the name is hidden ivar (the name without `@` prefix).
2019-07-30Do not change IO.pipe encodings if encodings explicitly givenJeremy Evans
This commit makes it so that if the binmode option is given with any encoding arguments, the reader and writer IO objects are not set to binary encoding. Fixes [Bug #12989]
2019-07-30Passing `binmode: true` to `IO.pipe` should behave like `binmode`Aaron Patterson
When passing `binmode: true` to `IO.pipe`, it should behave the same way as calling `binmode` on each of the file handles. It should set the file to binmode *and* set the encoding to binary on the file. Before this commit, passing `binmode: true` to `IO.pipe` would make `binmode?` return `true`, but the file's encoding would remain the same as the default encoding. Passing `binmode: true` should make `binmode?` return `true` *and* set the encoding to binary.
2019-07-30Do not always taint the result of File#pathJeremy Evans
The result should only be tainted if the path given to the method was tainted. The code to always taint the result was added in a4934a42cbb84b6679912226581c71b435671f55 (svn revision 4892) in 2003 by matz. However, the change wasn't mentioned in the commit message, and it may have been committed by accident. Skip part of a readline test that uses Reline. Reline in general would pass the test, but Reline's test mode doesn't raise a SecurityError if passing a tainted prompt and $SAFE >= 1. This was hidden earlier because File#path was always returning a tainted string. Fixes [Bug #14485]
2019-07-30Separate test_set_lineno_getsNobuyoshi Nakada
2019-07-29Revert "Do not always taint the result of File#path"Jeremy Evans
This reverts commit 1a759bfe5d554c22571d2e6e4e5998cf06a7b98f. This fails on some operating systems.
2019-07-29Do not always taint the result of File#pathJeremy Evans
The result should only be tainted if the path given to the method was tainted. The code to always taint the result was added in a4934a42cbb84b6679912226581c71b435671f55 (svn revision 4892) in 2003 by matz. However, the change wasn't mentioned in the commit message, and it may have been committed by accident. Skip part of a readline test that uses Reline. Reline in general would pass the test, but Reline's test mode doesn't raise a SecurityError if passing a tainted prompt and $SAFE >= 1. This was hidden earlier because File#path was always returning a tainted string. Fixes [Bug #14485]
2019-07-29Warn if using return at top-level with an argumentJeremy Evans
Fixes [Bug #14062]
2019-07-29Removed unused variables and methodsNobuyoshi Nakada
2019-07-27Occupy match dataNobuyoshi Nakada
* string.c (rb_str_split_m): occupy match data not to be modified during yielding the block. [Bug #16024]
2019-07-27Initialize DST flagNobuyoshi Nakada
* time.c (zone_timelocal): initialize DST flag by asking the timezone object. [Bug #15988]
2019-07-25Fix errno at seeking socket/pipe on WindowsNobuyoshi Nakada
[Bug #12230]
2019-07-24should not free local hook_list here.Koichi Sasada
exec_hooks_postcheck() clean executed hook_list if it is needed. list_exec is freed if there are no events and this list is local event (connected to specific iseq). However, iseq keeps to point this local hook_list, freed list. To prevent this situation, do not free hook_list here even if it has no events. This issue is reported by @joker1007. https://twitter.com/joker1007/status/1153649170797830144
2019-07-23Make Object#singleton_methods work correctly for singleton classes of objectsJeremy Evans
Fixes [Bug #10901]
2019-07-15Removed duplicate highlightingNobuyoshi Nakada
2019-07-15add tests for orphan/not-orphan proc/lambda.Tanaka Akira
2019-07-15add tests for "break" in lambda.Tanaka Akira
2019-07-14Check the result of String#-@Nobuyoshi Nakada