aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby
Commit message (Collapse)AuthorAgeFilesLines
* freeze all Range objects.v3_0_0_preview1Koichi Sasada2020-09-252-3/+8
| | | | | Matz want to try to freeze all Range objects. [Feature #15504]
* should not check taint flag on rubyspec.Koichi Sasada2020-09-252-2/+6
| | | | | Now taint flag is obsolete and it is used fro shareaable flag. So we should not check this flag.
* Disable deprecation warning by the default [Feature #16345]Nobuyoshi Nakada2020-09-257-32/+48
| | | | And `-w` option turns it on.
* Revert "Prevent SystemStackError when calling super in module with activated ↵Jeremy Evans2020-09-221-59/+20
| | | | | | | | | | | | | | refinement" This reverts commit eeef16e190cdabc2ba474622720f8e3df7bac43b. This also reverts the spec change. Preventing the SystemStackError would be nice, but there is valid code that the fix breaks, and it is probably more common than cases that cause the SystemStackError. Fixes [Bug #17182]
* Make Thread#join always convert its argument, as before 70f08f1eedBenoit Daloze2020-09-211-3/+2
|
* Fix Thread leak in Thread#join specsBenoit Daloze2020-09-211-1/+2
|
* Make `Thread#join` non-blocking.Samuel Williams2020-09-211-0/+5
|
* Update to ruby/spec@e829fb0Benoit Daloze2020-09-1727-134/+296
|
* Warn on a finalizer that captures the object to be finalizedChris Seaton2020-09-161-12/+116
| | | | | Also improve specs and documentation for finalizers and more clearly recommend a safe code pattern to use them.
* 2.8 -> 3.0 in specsBenoit Daloze2020-09-15147-201/+199
|
* Interpolated strings are no longer frozen with frozen-string-literal: trueBenoit Daloze2020-09-151-0/+17
| | | | | * Remove freezestring instruction since this was the only usage for it. * [Feature #17104]
* [ruby/ostruct] Fix dup/cloneMarc-Andre Lafortune2020-09-141-0/+2
|
* [ruby/ostruct] method_missing is privateMarc-Andre Lafortune2020-09-141-26/+3
|
* Make Mutex per-Fiber instead of per-ThreadBenoit Daloze2020-09-141-0/+12
| | | | | | | | | * Enables Mutex to be used as synchronization between multiple Fibers of the same Thread. * With a Fiber scheduler we can yield to another Fiber on contended Mutex#lock instead of blocking the entire thread. * This also makes the behavior of Mutex consistent across CRuby, JRuby and TruffleRuby. * [Feature #16792]
* Revert the related commits about `Tempfile.open` change.Hiroshi SHIBATA2020-09-091-25/+3
| | | | | Start with https://github.com/ruby/ruby/commit/fa21985a7a2f8f52a8bd82bd12a724e9dca74934 to https://github.com/ruby/ruby/commit/d7492a0be885ea9f2b9f71e3e95582f9a859c439
* Fix constant names set using const_set on a singleton classMarc-Andre Lafortune2020-09-023-12/+42
| | | | Fixes [Bug #14895]
* Deprecate iterator? methodNobuyoshi Nakada2020-08-311-6/+8
| | | | [Feature #15547] [Fix GH-2071]
* Thread.exclusive: delete卜部昌平2020-08-311-32/+34
| | | | | | Has been deprecated since 2069c9e031fc968d6d3d0fe30a9316851e4d91d8. [Feature #17125][ruby-core:99636]
* Adapt specs for the new Tempfile.open with block behaviorBenoit Daloze2020-08-291-3/+25
|
* Fix warnings related to new Socket.gethostby* deprecationsBenoit Daloze2020-08-292-18/+18
|
* Update to ruby/spec@335eb9bBenoit Daloze2020-08-2822-344/+556
|
* States Time.at expects rational-like argument to respond to #to_intNobuyoshi Nakada2020-08-281-0/+6
| | | | https://bugs.ruby-lang.org/issues/17131
* do not test --version卜部昌平2020-08-221-3/+9
| | | | | | | `llvm-strip-7` is a sane valid strip command that LLVM 7 ships, albeit it does not understand `--version`. It is a bad idea to check that option. Instead just see if the command actually strips something. A copy of `/bin/sh` should suffice. That file must be ubiquitous.
* [Feature #16513] TracePoint#inspect returns "... file:line" (#3391)Nguyễn Quang Minh2020-08-062-3/+106
| | | | | | | | | * Fix debug documents to match Thread#to_s change (Feature #16412 ticket) * TracePoint#inspect returns "... file:line" (Feature #16513) * Guard older version of Ruby in Tracepoint inspection tests * Focus on current thread only when running TracePoint inspection test
* Fix arity of Hash#to_proc [Bug #12671]Benoit Daloze2020-07-291-0/+4
|
* Use https instead of httpKazuhiro NISHIYAMA2020-07-283-6/+6
|
* Do not assume all compilers accept same flags as gccNobuyoshi Nakada2020-07-281-1/+1
|
* Update to ruby/spec@07164daBenoit Daloze2020-07-2738-44/+733
|
* Switch reserved for numbered parameter warning to SyntaxErrorJeremy Evans2020-07-221-10/+29
|
* Make StringIO encoding fixedNobuyoshi Nakada2020-07-202-3/+3
| | | | Get rid of affects by default external encoding.
* RBasci::flags (VALUE) doesn't match int.Koichi Sasada2020-07-151-6/+17
| | | | | The type of RBasic::flags is VALUE, and INT2FIX(flags) does not make sense. Use correct type to represent.
* Fixed yday and wday with timezone [Bug #17024]Nobuyoshi Nakada2020-07-121-0/+4
|
* Avoid deprecated OpenSSL::Digest constantsBart de Water2020-06-292-2/+2
|
* Update to ruby/spec@6c466d4Benoit Daloze2020-06-271-1/+1
|
* Update to ruby/spec@b6b7752Benoit Daloze2020-06-2735-55/+651
|
* Implement Proc#== and #eql?Jeremy Evans2020-06-193-9/+21
| | | | | | | | | | Previously, these were not implemented, and Object#== and #eql? were used. This tries to check the proc internals to make sure that procs created from separate blocks are treated as not equal, but procs created from the same block are treated as equal, even when the lazy proc allocation optimization is used. Implements [Feature #14267]
* Dup splat array in certain cases where there is a block argumentJeremy Evans2020-06-181-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes: ```ruby args = [1, 2, -> {}]; foo(*args, &args.pop) ``` call `foo` with 1, 2, and the lambda, in addition to passing the lambda as a block. This is different from the previous behavior, which passed the lambda as a block but not as a regular argument, which goes against the expected left-to-right evaluation order. This is how Ruby already compiled arguments if using leading arguments, trailing arguments, or keywords in the same call. This works by disabling the optimization that skipped duplicating the array during the splat (splatarray instruction argument switches from false to true). In the above example, the splat call duplicates the array. I've tested and cases where a local variable or symbol are used do not duplicate the array, so I don't expect this to decrease the performance of most Ruby programs. However, programs such as: ```ruby foo(*args, &bar) ``` could see a decrease in performance, if `bar` is a method call and not a local variable. This is not a perfect solution, there are ways to get around this: ```ruby args = Struct.new(:a).new([:x, :y]) def args.to_a; a; end def args.to_proc; a.pop; ->{}; end foo(*args, &args) # calls foo with 1 argument (:x) # not 2 arguments (:x and :y) ``` A perfect solution would require completely disabling the optimization. Fixes [Bug #16504] Fixes [Bug #16500]
* Suppress warnings [Feature #15973]Nobuyoshi Nakada2020-06-134-6/+6
|
* Refined ioctl error descriptionNobuyoshi Nakada2020-06-111-2/+2
|
* Make proc/Proc.new without block an error instead of warningJeremy Evans2020-06-102-2/+2
| | | | The warning for these was added in 2.7.
* ENV.delete should return the result of block on non-existing keyNobuyoshi Nakada2020-06-101-0/+7
| | | | | | | Fixes [Bug #16173] Co-Authored-By: Burdette Lamar <burdettelamar@yahoo.com> Co-Authored-By: Jeremy Evans <code@jeremyevans.net>
* Fix build failuresYuki Nishijima2020-06-061-2/+2
|
* Ensure origins for all included, prepended, and refined modulesJeremy Evans2020-06-031-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes various issues when a module is included in or prepended to a module or class, and then refined, or refined and then included or prepended to a module or class. Implement by renaming ensure_origin to rb_ensure_origin, making it non-static, and calling it when refining a module. Fix Module#initialize_copy to handle origins correctly. Previously, Module#initialize_copy did not handle origins correctly. For example, this code: ```ruby module B; end class A def b; 2 end prepend B end a = A.dup.new class A def b; 1 end end p a.b ``` Printed 1 instead of 2. This is because the super chain for a.singleton_class was: ``` a.singleton_class A.dup B(iclass) B(iclass origin) A(origin) # not A.dup(origin) ``` The B iclasses would not be modified, so the includer entry would be still be set to A and not A.dup. This modifies things so that if the class/module has an origin, all iclasses between the class/module and the origin are duplicated and have the correct includer entry set, and the correct origin is created. This requires other changes to make sure all tests still pass: * rb_undef_methods_from doesn't automatically handle classes with origins, so pass it the origin for Comparable when undefing methods in Complex. This fixed a failure in the Complex tests. * When adding a method, the method cache was not cleared correctly if klass has an origin. Clear the method cache for the klass before switching to the origin of klass. This fixed failures in the autoload tests related to overridding require, without breaking the optimization tests. Also clear the method cache for both the module and origin when removing a method. * Module#include? is fixed to skip origin iclasses. * Refinements are fixed to use the origin class of the module that has an origin. * RCLASS_REFINED_BY_ANY is removed as it was only used in a single place and is no longer needed. * Marshal#dump is fixed to skip iclass origins. * rb_method_entry_make is fixed to handled overridden optimized methods for modules that have origins. Fixes [Bug #16852]
* Quarantine specs which fail frequently with CHECK_LEAKS=trueBenoit Daloze2020-06-031-0/+2
|
* Add a spec for the new NoMethodError display of the receiverJean Boussier2020-06-021-0/+18
|
* Make sure rb_enc_str_new_static() is used when enc is NULLBenoit Daloze2020-06-011-2/+7
| | | | | | * The definition of the rb_enc_str_new_cstr macro depends on HAVE_BUILTIN___BUILTIN_CONSTANT_P. * It SEGV on mswin otherwise.
* Update to ruby/spec@4e486faBenoit Daloze2020-05-3146-99/+634
|
* Fix error raised by Net::HTTPResponse#inflater if the block raisesBenoit Daloze2020-05-311-0/+67
| | | | * See https://bugs.ruby-lang.org/issues/13882#note-6
* Fix spec description for Net::HTTP.getBenoit Daloze2020-05-311-1/+1
|
* spec: add wsl guardYusuke Endoh2020-05-301-1/+1
| | | | | | | | | | WSL 2 is officially released. It uses Linux kernel, so almost all specs for Linux work on WSL, except one: gethostbyaddr. I guess network resolution in WSL is based on Windows, so the behavior seems a bit different from normal Linux. This change adds `platform_is_not :wsl` guard, and guards out the test in question.