summaryrefslogtreecommitdiff
path: root/spec/ruby
AgeCommit message (Collapse)Author
2020-07-20Make StringIO encoding fixedNobuyoshi Nakada
Get rid of affects by default external encoding. Notes: Merged: https://github.com/ruby/ruby/pull/3334
2020-07-15RBasci::flags (VALUE) doesn't match int.Koichi Sasada
The type of RBasic::flags is VALUE, and INT2FIX(flags) does not make sense. Use correct type to represent.
2020-07-12Fixed yday and wday with timezone [Bug #17024]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3312
2020-06-29Avoid deprecated OpenSSL::Digest constantsBart de Water
Notes: Merged: https://github.com/ruby/ruby/pull/3270
2020-06-27Update to ruby/spec@6c466d4Benoit Daloze
2020-06-27Update to ruby/spec@b6b7752Benoit Daloze
2020-06-19Implement Proc#== and #eql?Jeremy Evans
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] Notes: Merged: https://github.com/ruby/ruby/pull/3174
2020-06-18Dup splat array in certain cases where there is a block argumentJeremy Evans
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] Notes: Merged: https://github.com/ruby/ruby/pull/3157
2020-06-13Suppress warnings [Feature #15973]Nobuyoshi Nakada
2020-06-11Refined ioctl error descriptionNobuyoshi Nakada
2020-06-10Make proc/Proc.new without block an error instead of warningJeremy Evans
The warning for these was added in 2.7. Notes: Merged: https://github.com/ruby/ruby/pull/3208
2020-06-10ENV.delete should return the result of block on non-existing keyNobuyoshi Nakada
Fixes [Bug #16173] Co-Authored-By: Burdette Lamar <burdettelamar@yahoo.com> Co-Authored-By: Jeremy Evans <code@jeremyevans.net> Notes: Merged: https://github.com/ruby/ruby/pull/3206
2020-06-06Fix build failuresYuki Nishijima
Notes: Merged: https://github.com/ruby/ruby/pull/3135
2020-06-03Ensure origins for all included, prepended, and refined modulesJeremy Evans
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] Notes: Merged: https://github.com/ruby/ruby/pull/3140
2020-06-03Quarantine specs which fail frequently with CHECK_LEAKS=trueBenoit Daloze
2020-06-02Add a spec for the new NoMethodError display of the receiverJean Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/3176
2020-06-01Make sure rb_enc_str_new_static() is used when enc is NULLBenoit Daloze
* The definition of the rb_enc_str_new_cstr macro depends on HAVE_BUILTIN___BUILTIN_CONSTANT_P. * It SEGV on mswin otherwise.
2020-05-31Update to ruby/spec@4e486faBenoit Daloze
2020-05-31Fix error raised by Net::HTTPResponse#inflater if the block raisesBenoit Daloze
* See https://bugs.ruby-lang.org/issues/13882#note-6 Notes: Merged: https://github.com/ruby/ruby/pull/3164
2020-05-31Fix spec description for Net::HTTP.getBenoit Daloze
Notes: Merged: https://github.com/ruby/ruby/pull/3164
2020-05-30spec: add wsl guardYusuke Endoh
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.
2020-05-26Use receiver #name rather than #inspect to build NameError messageJean Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/3080
2020-05-14Thread scheduler for light weight concurrency.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3032 Merged-By: ioquatix <samuel@codeotaku.com>
2020-05-09Fix a typo [ci skip]Kazuhiro NISHIYAMA
2020-05-03Update to ruby/spec@032ee74Benoit Daloze
2020-05-03Show unreserved bits onlyNobuyoshi Nakada
`RUBY_FL_SEEN_OBJ_ID` can be set by #object_id.
2020-05-03spec/ruby/core/process/clock_getres_spec.rb: lax the resolution limitYusuke Endoh
Android is Linux, but the clock resolution is 10 milliseconds. I think that 1 microsecond is too strict for embedded environment. This change laxes the limit to 10 milliseconds.
2020-05-03DO NOT CORRUPT TYPE FLAGSNobuyoshi Nakada
2020-05-03Fixed missing `should`Nobuyoshi Nakada
2020-05-02append newline at EOF [ci skip]Nobuyoshi Nakada
2020-05-02Command failed to run just failsNobuyoshi Nakada
The exact exit status value of command failed to run is not a spec, but a platform dependent implementation detail. Just it is not "success".
2020-05-02Fix ObjectSpace::WeakMap#key? to work if the value is nilBenoit Daloze
* Fixes [Bug #16826]
2020-05-02Update to ruby/spec@d394dfdBenoit Daloze
2020-05-01Fixed a message and version guard then moved to the existing blockNobuyoshi Nakada
2020-05-01Fix a typoTakashi Kokubun
2020-05-01Fix matrix spec for 7d360efe92d2db11a4e51820ed2f52de36b3257fTakashi Kokubun
2020-04-29[ruby/spec] Temporary directories should be under the mock_dirNobuyoshi Nakada
2020-04-26[ruby/spec] Removed space between method name and argument list parenNobuyoshi Nakada
2020-04-26[ruby/spec] Fixed missing shouldNobuyoshi Nakada
2020-04-19Skip Process#clock_getres specs on AndroidYusuke Endoh
... just like AIX and OpenBSD.
2020-04-17Removed NIL/TRUE/FALSENobuyoshi Nakada
Deprerecated constants which had been warned since 2.4.
2020-04-10Endless method definition [Feature #16746]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2996
2020-04-10Turn class variable warnings into exceptionsJeremy Evans
This changes the following warnings: * warning: class variable access from toplevel * warning: class variable @foo of D is overtaken by C into RuntimeErrors. Handle defined?(@@foo) at toplevel by returning nil instead of raising an exception (the previous behavior warned before returning nil when defined? was used). Refactor the specs to avoid the warnings even in older versions. The specs were checking for the warnings, but the purpose of the related specs as evidenced from their description is to test for behavior, not for warnings. Fixes [Bug #14541] Notes: Merged: https://github.com/ruby/ruby/pull/2987
2020-04-08Suppress -Wshorten-64-to-32 warningsNobuyoshi Nakada
2020-04-08Merge pull request #2991 from shyouhei/ruby.h卜部昌平
Split ruby.h Notes: Merged-By: shyouhei <shyouhei@ruby-lang.org>
2020-04-06Use `rb_warn_deprecated` for `File.exists?` and `Dir.exists?`Nobuyoshi Nakada
2020-04-04Fixed the location of the shared libraryNobuyoshi Nakada
On platform where searchs shared libraries by `PATH` environment variable (i.e., Windows), the shared library is installed in `bindir`. On other platforms, the library directory is directed by `libdirname` indirectly.
2020-04-04rbconfig_spec.rb: removed needless windows guardNobuyoshi Nakada
This reverts commit 34b0a7be0ed2fd4ca4d1d509a22964b5e61dfe34.
2020-04-04Update to ruby/spec@7289ea3Benoit Daloze
2020-04-03Use `platform_is` guardNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2997