aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow trailing comma in hash patternKazuki Tsujimoto2020-03-271-0/+9
| | | | (cherry picked from commit d25a4f413dce6ad3a8baaf61591415b9a8cce082)
* Make RbConfig::CONFIG values mutable [Bug #16738]Nobuyoshi Nakada2020-03-271-0/+9
| | | | | | | As `RbConfig.expand` modifies the argument and involved `CONFIG` values, its values should be mutable. (cherry picked from commit 4adb2d655dcd54b28366b4d17e86b21e2b622cd1)
* test/openssl/test_ssl.rb: ignore SSLError when the connection is closedYusuke Endoh2020-03-261-1/+6
| | | | | | | | | | | | | | | | | | | | "test_close_after_socket_close" checks if ssl.close is no-op even after the wrapped socket is closed. The test itself is fair, but the other endpoint that is reading the SSL connection may fail with SSLError: "SSL_read: unexpected eof while reading" in some environments: https://github.com/ruby/ruby/actions/runs/60085389 (MinGW) https://rubyci.org/logs/rubyci.s3.amazonaws.com/android28-x86_64/ruby-master/log/20200321T034442Z.fail.html.gz ``` 1) Failure: OpenSSL::TestSSL#test_close_after_socket_close [D:/a/ruby/ruby/src/test/openssl/utils.rb:299]: exceptions on 1 threads: SSL_read: unexpected eof while reading ``` This changeset rescues and ignores the SSLError in the test. (cherry picked from commit be76e86e69106c6906322dc30aa75c3ff65da63c)
* check ar_table after `#hash` callKoichi Sasada2020-03-261-0/+58
| | | | | | | | | ar_table can be converted to st_table just after `ar_do_hash()` function which calls `#hash` method. We need to check the representation to detect this mutation. [Bug #16676] (cherry picked from commit 4c019f5a626523e99e2827ed917802e3097c380d)
* [ruby/stringio] StringIO#initialize default to the source string encodingJean Boussier2020-03-151-0/+12
| | | | | | | [Bug #16497] https://github.com/ruby/stringio/commit/4958a5ccab (cherry picked from commit e257c08f2ec27e2d66cdfa7e2415deb492522e22)
* Do not autosplat when calling proc with empty keyword splatJeremy Evans2020-03-151-0/+20
| | | | | | | | | | | | | | With the removal of the splatted argument when using an empty keyword splat, the autosplat code considered an empty keyword splat the same as no argument at all. However, that results in autosplat behavior changing dependent on the content of the splatted hash, which is not what anyone would expect or want. This change always skips an autosplat if keywords were provided. Fixes [Bug #16560] (cherry picked from commit c1d8829ef515ee51fadeadd7dd022b5c47a71cdd)
* Prevent unloading methods used in root_fiber while calling another Fiber (#2939)Takashi Kokubun2020-03-151-5/+27
| | | | | | | | | | Fixing SEGVs like: http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2744905 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2744420 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2741400 [Bug #16664] (cherry picked from commit adcf0316d1ecedae2a9157ad941550e0c0fb510b)
* Avoid infinite loop on --jit-waitTakashi Kokubun2020-03-151-4/+26
| | | | (cherry picked from commit a8dcab723316997d9e01c89d6df969edce75bdca)
* Fix SimpleDelegator respond_to? regressionJean Boussier2020-03-151-0/+14
| | | | | | | | | | | In 2.6, SimpleDelegator would always use the target `respond_to?` In 2.7.0 it doesn't if the target does not inherit from Object. This breaks compatibility for delegated objects that inherit from BasicObject and redefine `respond_to?`. [Bug #16606] (cherry picked from commit f2552216d43040cd42bbb9fd484eab6c70856fe6)
* delegate.rb: fixed keyword arguments in DelegateClassNobuyoshi Nakada2020-03-151-0/+8
| | | | | | | `Delegator.delegating_block` should delegate keyword arguments separately. [ruby-core:96949] (cherry picked from commit 9bcf4f3db26249772c983896ebbc9ff41f4614db)
* Make ruby2_keywords methods correctly handle **{} optimizationJeremy Evans2020-03-151-0/+14
| | | | | | | | | | | | | | | | Previously, this code: ruby2_keywords def foo(*a) a.last end foo(**{}) Returned an empty frozen hash. However, the final hash should not be frozen in this case, as it wouldn't be if foo accepted a keyword splat. Use a new unfrozen empty hash instead of reusing the frozen empty hash in this case. Fixes [Bug #16642]
* Don't display singleton class in Method#inspect unless method defined thereJeremy Evans2020-03-141-0/+8
| | | | | | | | | | | | | | Previously, if an object has a singleton class, and you call Object#method on the object, the resulting string would include the object's singleton class, even though the method was not defined in the singleton class. Change this so the we only show the singleton class if the method is defined in the singleton class. Fixes [Bug #15608] (cherry picked from commit e02bd0e713ef920e6d12c27f16548f48ec5c2cf0)
* Fixed duplicated warningNobuyoshi Nakada2020-03-141-0/+6
| | | | | | | As `command_rhs` is always a "value expression", `command_asgn` does not need the same check. [Bug #16619] (cherry picked from commit 6e6844320de989cb88a154e2ac75066ccea1bba2)
* Fixed symbol misused as IDNobuyoshi Nakada2020-03-141-0/+8
| | | | | | | `rb_funcallv_public` and `rb_respond_to` require an `ID`, not a `Symbol`. [Bug #16649] (cherry picked from commit 8b6e2685a4b7c7de905f7ed60c02ef85e0724754)
* Pass keyword arguments to IOs properly [Bug #16639]Nobuyoshi Nakada2020-03-131-0/+7
| | | | (cherry picked from commit 041c2932e336b509b0ddc1fdbd9f160bce8d4893)
* lib/drb/drb.rb: Use ruby2_keywords for keyword separationYusuke Endoh2020-03-132-0/+28
| | | | | | [Bug #16634] (cherry picked from commit fb472ca7adbaceb35aae1b3a6b948720ffc9eb53)
* Add the loaded feature after no exception raisedNobuyoshi Nakada2020-03-131-0/+7
| | | | | | | Retrying after rescued `require` should try to load the same library again. [Bug #16607] (cherry picked from commit 7d6903dc476f982e7b432adbeef3a3d9372a309f)
* Squashed commit of the following: [Backport #16516]NARUSE, Yui2020-03-132-1/+10
| | | | | | | | | | | | | | commit c98c492578d898dc07a04b8240d8d5b1508ffafa Author: Nobuyoshi Nakada <nobu@ruby-lang.org> Date: Fri Jan 17 16:56:53 2020 +0900 Added test for f38b3e8c707ebdcad05aa9485cf1760640b74fbb commit f38b3e8c707ebdcad05aa9485cf1760640b74fbb Author: Nobuyoshi Nakada <nobu@ruby-lang.org> Date: Thu Jan 16 18:34:31 2020 +0900 Fixed the location of args node with numbered parameter
* Disable GC until VM objects get initialized [Bug #16616]Nobuyoshi Nakada2020-03-131-0/+1
|
* Avoid jumping to a wrong destinationTakashi Kokubun2020-02-201-0/+10
| | | | when the next insn is already compiled by former branches.
* Fix typo s/test_ruby2_keywords_hash!/test_ruby2_keywords_hash/Ryuta Kamizono2020-02-181-1/+1
| | | In #2818, `Hash.ruby2_keywords!` has renamed to `Hash.ruby2_keywords_hash`.
* hash.c: Add a feature to manipulate ruby2_keywords flagYusuke Endoh2020-02-181-0/+24
| | | | | | | | | | | | | | | It was found that a feature to check and add ruby2_keywords flag to an existing Hash is needed when arguments are serialized and deserialized. It is possible to do the same without explicit APIs, but it would be good to provide them as a core feature. https://github.com/rails/rails/pull/38105#discussion_r361863767 Hash.ruby2_keywords_hash?(hash) checks if hash is flagged or not. Hash.ruby2_keywords_hash(hash) returns a duplicated hash that has a ruby2_keywords flag, [Bug #16486]
* Restart timer thread even after preparation failedNobuyoshi Nakada2020-02-131-0/+9
| | | | | If the timer thread is left stopped, memory crash or segfault can happen. [Bug #16624]
* MinGW on Actions (#2791)MSP-Greg2020-01-302-4/+17
| | | | | | | | | | | | | | | | | | | * MinGW - skip spec in spec/ruby/optional/capi/thread_spec.rb C-API Thread function rb_thread_call_without_gvl -- runs a C function with the global lock unlocked and unlocks IO with the generic RUBY_UBF_IO stops/freezes spec tests See https://bugs.ruby-lang.org/issues/16265 * MinGW - skip test test/resolv/test_dns.rb Test times out in CI (both AppVeyor & Actions), cannot repo locally * MinGW - skip test test/ruby/test_thread_queue.rb * Add Actions mingw.yml
* Fixed a segfault `GC.verify_compaction_references`Nobuyoshi Nakada2020-01-301-0/+2
| | | | | Which is by coercion of `Qundef`, when any keyword argument without `toward:` option is given. [Bug #16598]
* `Regexp` in `MatchData` can be `nil`Nobuyoshi Nakada2020-01-161-0/+4
| | | | | | | `String#sub` with a string pattern defers creating a `Regexp` until `MatchData#regexp` creates a `Regexp` from the matched string. `Regexp#last_match(group_name)` accessed its content without creating the `Regexp` though. [Bug #16508]
* script_compiled event on compile error.Koichi Sasada2020-01-161-0/+9
| | | | | | script_compiled event for TracePoint should not be invoked on compile error (SyntaxError) because it is not "compiled". [Bug #16459]
* range.c: Range#min with a beginless one now raise an explicit exceptionYusuke Endoh2019-12-251-0/+6
| | | | [Bug #16450]
* ^D on non-empty line in vi mode behaves like Enteraycabta2019-12-251-8/+11
|
* Scale sleeping times to wait for the OS operationsNobuyoshi Nakada2019-12-241-0/+4
|
* The delete-char-or-list shows completed list when called at end of lineaycabta2019-12-241-3/+40
| | | | It doesn't behave the same as the delete-char.
* Synchronize with a Queue instead of sleepingNobuyoshi Nakada2019-12-241-4/+12
|
* Revert "Scale sleeping times"Koichi Sasada2019-12-241-4/+0
| | | | | | | | This reverts commit e57d6194218efc73c30f3fed9dd321d2e357030b. Test fails: http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sky1/2518563 http://ci.rvm.jp/results/trunk-gc_compact@silicon-docker/2518533
* Scale sleeping timesNobuyoshi Nakada2019-12-241-0/+4
|
* Get rid of false positive misspellingsNobuyoshi Nakada2019-12-241-7/+8
| | | | [Bug #16437]
* [ruby/rdoc] Support newline in the middle of constant definitionaycabta2019-12-241-1/+1
| | | | https://github.com/ruby/rdoc/commit/74d3984324
* [ruby/rdoc] Treat Proc#call syntax sugar for constant correctlyaycabta2019-12-241-0/+11
| | | | https://github.com/ruby/rdoc/commit/957d041ae0
* Reword keyword arguments warning messages to convey these are deprecation ↵Marc-Andre Lafortune2019-12-2310-487/+487
| | | | warnings
* ObjectSpace._id2ref should check liveness.Koichi Sasada2019-12-231-0/+20
| | | | | objspace->id_to_obj_tbl can contain died objects because of lazy sweep, so that it should check liveness.
* Port ↵Yuki Nishijima2019-12-231-0/+0
| | | | https://github.com/ruby/did_you_mean/commit/dd1dd86e6c3188c36224d5dd4389676e6653a727
* Revert "Should return "." for File.extname("file.") also on Windows"NAKAMURA Usaku2019-12-232-4/+8
| | | | | | | | We want to introduce consistency and better compatibility with unixen, but the Windows APIs doues not have consistency fundamentally and we can not found any logical way... This reverts commit 61aff0cd189e67fa6f2565639ad0128fa33b88fc.
* fix a thread test.Koichi Sasada2019-12-221-7/+7
| | | | | | * Use Queue for synchronization. * Don't use `sleep 0.2` and use `th.join` because created thread can raise an exception after 0.2 seconds.
* compile.c: avoid newarraykwsplat for argumentsv2_7_0_rc2Yusuke Endoh2019-12-221-0/+6
| | | | | | | | | | | | | | `foo(*rest, post, **empty_kw)` is compiled like `foo(*rest + [post, **empty_kw])`, and `**empty_kw` is removed by "newarraykwsplat" instruction. However, the method call still has a flag of KW_SPLAT, so "post" is considered as a keyword hash, which caused a segfault. Note that the flag cannot be removed if "empty_kw" is not always empty. This change fixes the issue by compiling arguments with "newarray" instead of "newarraykwsplat". [Bug #16442]
* Should return "." for File.extname("file.") also on WindowsNAKAMURA Usaku2019-12-222-8/+4
| | | | | But not changes another cases, such as "file.rb." [Bug #15267]
* Kernel#lambda: return forwarded block as non-lambda procAlan Wu2019-12-211-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Before this commit, Kernel#lambda can't tell the difference between a directly passed literal block and one passed with an ampersand. A block passed with an ampersand is semantically speaking already a non-lambda proc. When Kernel#lambda receives a non-lambda proc, it should simply return it. Implementation wise, when the VM calls a method with a literal block, it places the code for the block on the calling control frame and passes a pointer (block handler) to the callee. Before this commit, the VM forwards block arguments by simply forwarding the block handler, which leaves the slot for block code unused when a control frame forwards its block argument. I use the vacant space to indicate that a frame has forwarded its block argument and inspect that in Kernel#lambda to detect forwarded blocks. This is a very ad-hoc solution and relies *heavily* on the way block passing works in the VM. However, it's the most self-contained solution I have. [Bug #15620]
* test/ruby/test_pattern_matching.rb: suppress "unused variable" warningYusuke Endoh2019-12-211-0/+17
|
* Added `-W:experimental` command line optionNobuyoshi Nakada2019-12-201-0/+6
| | | | [Feature #16420]
* Added `experimental` warning categoryNobuyoshi Nakada2019-12-202-4/+23
| | | | [Feature #16420]
* Added -W: command line optionNobuyoshi Nakada2019-12-201-0/+9
| | | | | To manage `Warning[category]` flags. Only `-W:deprecated` and `-W:no-deprecated` are available now. [Feature #16345]
* vm_args.c: rephrase the warning message of keyword argument separationYusuke Endoh2019-12-209-347/+347
| | | | | | | | | | (old) test.rb:4: warning: The last argument is used as the keyword parameter test.rb:1: warning: for `foo' defined here; maybe ** should be added to the call? (new) test.rb:4: warning: The last argument is used as keyword parameters; maybe ** should be added to the call test.rb:1: warning: The called method `foo' is defined here