aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/fiddle] Fix a failing test (#13)Kenta Murata2019-10-241-0/+11
| | | | | | | | | | | | | | | | | | | | | * Fix a failing test This commit fixes the following failure: ``` 1) Failure: Fiddle::TestImport#test_no_message_with_debug [/Users/mrkn/src/github.com/ruby/fiddle/test/fiddle/test_import.rb:152]: 1. [2/2] Assertion for "stderr" | <[]> expected but was | <["Exception `NameError' at /Users/mrkn/.rbenv/versions/2.5.1/lib/ruby/2.5.0/fiddle/import.rb:157 - uninitialized constant Fiddle::Function::STDCALL"]>. ``` * Stop using Bundler.with_clean_env * Clear existing Ruby environment variables on test_no_message_with_debug https://github.com/ruby/fiddle/commit/13133ddec8
* [ruby/date] Simplify #inspectzverok2019-10-241-0/+2
| | | | https://github.com/ruby/date/commit/af01edd7d8
* [ruby/date] Remove taint supportJeremy Evans2019-10-242-31/+1
| | | | | | | | Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous versions. https://github.com/ruby/date/commit/519470dc3b
* [ruby/date] Support -Float::INFINITY...date rangesJeremy Evans2019-10-241-0/+13
| | | | | | Fixes Ruby Bug 12961 https://github.com/ruby/date/commit/7f533c2552
* [ruby/date] Check for numeric arguments in constructorsJeremy Evans2019-10-241-0/+50
| | | | | | | | | | | | | | | Previously, the type of these arguments were not checked, leading to NoMethodErrors in some cases, and TypeErrors in other cases, but not showing what field was having the problems. This change makes it so the field with the problem is included in the error message. For the valid_*? methods, this changes them to return false if one of the arguments that should be numeric is not. Fixes Ruby Bug 11935 Fixes Ruby Misc 15298 https://github.com/ruby/date/commit/a2f4b665f8
* [ruby/date] Make julian dates roundtrip through to_time.to_dateJeremy Evans2019-10-241-0/+18
| | | | | | | | | | | | | | | Previously, julian dates would not round trip through to_time.to_date, because Time is always considered gregorian. This converts the Date instance from julian to gregorian before converting to Time, ensuring that an equal date object will be returned if converting that Time back to Date. This does result in julian Date objects showing different day values if converting to Time. Fixes Ruby Bug 8428. https://github.com/ruby/date/commit/d8df64555e
* Revert "Fix Fiber#transfer"Koichi Sasada2019-10-241-4/+6
| | | | | | This reverts commit fa8ac91e957a076f6df1adaecad7896817138009. Previous behavior is intentional.
* Use dedicated assertion methods for warning and syntax errorNobuyoshi Nakada2019-10-231-23/+15
|
* test/ruby/test_exception typo fixMSP-Greg2019-10-221-1/+1
|
* Fix Fiber#transferJeremy Evans2019-10-211-6/+4
| | | | | | | | | | | | | Fiber#transfer previously made it impossible to resume the fiber if it was transferred to (no resuming the target of Fiber#transfer). However, the documentation specifies that you cannot resume a fiber that has transferred to another fiber (no resuming the source of Fiber#transfer), unless control is transferred back. Fix the code by setting the transferred flag on the current/source fiber, and unsetting the transferred flag on the target fiber. Fixes [Bug #9664] Fixes [Bug #12555]
* Arguments forwarding [Feature #16253]Nobuyoshi Nakada2019-10-222-0/+46
|
* bignum.c (estimate_initial_sqrt): prevent integer overflowYusuke Endoh2019-10-211-0/+3
| | | | | `Integer.sqrt(0xffff_ffff_ffff_ffff ** 2)` caused assertion failure because of integer overflow. [ruby-core:95453] [Bug #16269]
* Pass the called keyword arguments if `keyword_init`Nobuyoshi Nakada2019-10-211-0/+4
|
* test/optparse/test_did_you_mean.rb - fix suggestion orderMSP-Greg2019-10-211-3/+3
|
* DidYouMean can be an empty stub module [Bug #16263]Nobuyoshi Nakada2019-10-211-1/+1
|
* test_exception - fix with & w/o did_you_meanMSP-Greg2019-10-211-2/+5
| | | | See Ruby issue 16263
* make monitor.so for performance. (#2576)Koichi Sasada2019-10-201-8/+8
| | | | | | | | | | | | | | | Recent monitor.rb has performance problem because of interrupt handlers. 'Monitor#synchronize' is frequently used primitive so the performance of this method is important. This patch rewrite 'monitor.rb' with 'monitor.so' (C-extension) and make it faster. See [Feature #16255] for details. Monitor class objects are normal object which include MonitorMixin. This patch introduce a Monitor class which is implemented on C and MonitorMixin uses Monitor object as re-entrant (recursive) Mutex. This technique improve performance because we don't need to care atomicity and we don't need accesses to instance variables any more on Monitor class.
* Support DidYouMean by AmbiguousOption tooNobuyoshi Nakada2019-10-181-0/+6
|
* Default DidYouMean.formatter to PlainFormatterNobuyoshi Nakada2019-10-181-1/+5
|
* Added no suggestion test caseNobuyoshi Nakada2019-10-181-0/+5
|
* Use DidYouMean.formatterNobuyoshi Nakada2019-10-181-7/+18
| | | | Instead of building messages separately.
* lib/optparse.rb: Show a did_you_mean hint for unknown optionYusuke Endoh2019-10-181-0/+22
| | | | | | | | | | | | | | | | | | | | ``` require 'optparse' OptionParser.new do |opts| opts.on("-f", "--foo", "foo") {|v| } opts.on("-b", "--bar", "bar") {|v| } opts.on("-c", "--baz", "baz") {|v| } end.parse! ``` ``` $ ruby test.rb --baa Traceback (most recent call last): test.rb:7:in `<main>': invalid option: --baa (OptionParser::InvalidOption) Did you mean? baz bar ```
* Look up constant instead of caching in a globalAaron Patterson2019-10-171-0/+37
| | | | | The global can go bad if the compactor runs, so we need to look up the constant instead of caching it in a global.
* Update test to handle x32 ABI compiled Ruby on LinuxJeremy Evans2019-10-171-0/+1
| | | | | | Suggestion from Laurence Parry. Fixes [Bug #16030]
* Make circular argument reference a SyntaxError instead of a warningJeremy Evans2019-10-171-18/+10
| | | | Fixes [Bug #10314]
* Fixed File.extname at a name ending with a dotNobuyoshi Nakada2019-10-172-6/+12
| | | | | File.extname now returns a dot string at a name ending with a dot. [Bug #15267]
* Regexp#match{?} with nil raises TypeError as String, Symbol (#1506)Kenichi Kamiya2019-10-173-2/+12
| | | | | | | | | | | | | | | | | | | | | | | * {String|Symbol}#match{?} with nil returns falsy To improve consistency with Regexp#match{?} * String#match(nil) returns `nil` instead of TypeError * String#match?(nil) returns `false` instead of TypeError * Symbol#match(nil) returns `nil` instead of TypeError * Symbol#match?(nil) returns `false` instead of TypeError * Prefer exception * Follow empty ENV * Drop outdated specs * Write ruby/spec for above https://github.com/ruby/ruby/pull/1506/files#r183242981 * Fix merge miss
* Fix DRbServer#any_to_sJeremy Evans2019-10-161-0/+14
| | | | | | | | My previous fix in d0ed935d5bf8c3fce9800742a36e44fb7f63dda4 was not correct, as pointed out by cremno on GitHub. This simplifies things by just using Kernel#to_s. Also switch to bind_call(obj) instead of bind(obj).call for better performance.
* Do not raise an exception on a closed DRb socketJeremy Evans2019-10-161-0/+15
| | | | | | | | | This rescues some exceptions that could happen with a closed or shutdown DRb socket. This can prevent the server from exiting if an client socket is closed directly after it is accepted. Fixes [Bug #8039]
* Warn for calling public/protected/private/module_function without arguments ↵Jeremy Evans2019-10-162-0/+53
| | | | | | | | | inside method Calling these methods without an argument does not have the desired effect inside a method. Fixes [Bug #13249]
* Temporarily drop test_jit_debug.rbTakashi Kokubun2019-10-161-11/+0
| | | | | | | | Still some CIs are failing: https://ci.appveyor.com/project/ruby/ruby/builds/28141041/job/v4hfc99sjefqabkk http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/2317313 I'll fix them later.
* Added test for rdoc `--force-update` optionNobuyoshi Nakada2019-10-161-0/+14
|
* Removed an unused assignmentNobuyoshi Nakada2019-10-161-2/+0
|
* Do not test --jit-debug on -DVM_CHECK_MODETakashi Kokubun2019-10-151-0/+3
|
* Enforce --jit-debug test by another wayTakashi Kokubun2019-10-152-1/+9
|
* Dup hash with keyword flag when converted to keywordsJeremy Evans2019-10-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | When ruby2_keywords is used on a method, keywords passed to the method are flagged. When the hash is passed as the last element of an argument splat to another method, the hash should be treated as a keyword splat. When keyword splatting a hash, a duplicate of the hash is made. So when auto-splatting the hash with the keyword flag, a duplicate of the hash should also be made. This fixes cases where the hash is later passed to another method and would be treated as keywords there: class Object ruby2_keywords def foo(*a) bar(*a) end def bar(*a) baz(*a) end def baz(*a, **kw) [a, kw] end end foo(:a=>1) Previously, this would pass the :a=>1 as keywords to bar and also as keywords to baz. Now it only passes :a=>1 as keywords to bar, but bar passes :a=>1 as a positional hash to baz (which in this case generates a warning in 2.7).
* Comparable#clamp with a range [Feature #14784]Nobuyoshi Nakada2019-10-161-0/+23
|
* test/csv/write/test_general.rb: suppress warningsYusuke Endoh2019-10-151-0/+4
| | | | of "setting Encoding.default_internal".
* [rubygems/rubygems] Also bump test variableHiroshi SHIBATA2019-10-151-1/+1
| | | | https://github.com/rubygems/rubygems/commit/97e9768612
* Try to avoid random failureKazuhiro NISHIYAMA2019-10-151-1/+3
| | | | | | | | | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20191015T070011Z.fail.html.gz ``` 1) Failure: TestProcess#test_kill_at_spawn_failure [/home/chkbuild/chkbuild/tmp/build/20191015T070011Z/ruby/test/ruby/test_process.rb:2276]: [ruby-core:69304] [Bug #11166]. <#<Thread:0x000009f60a7cac40@/home/chkbuild/chkbuild/tmp/build/20191015T070011Z/ruby/test/ruby/test_process.rb:2272 dead>> expected but was <nil>. ``
* IRB colorize: take into account recursive arrays and hashes (#2555)Ary Borenszweig2019-10-141-0/+2
| | | [Bug #16250]
* [flori/json] fix test as reported in #343Florian Frank2019-10-141-1/+1
| | | | https://github.com/flori/json/commit/565c72ba9e
* [flori/json] Fixed unexpected illegal/malformed utf-8 errorNobuyoshi Nakada2019-10-141-0/+6
| | | | | | | | flori/json@c34d01ff6a18dac04a90b2e0f820cdb1d5c7e1b2 does not consider US-ASCII compatible but non-UTF-8 encodings, and causes an error in RDoc tests. https://github.com/flori/json/commit/4f471bf590
* Fix some DRb issues (#2552)Jeremy Evans2019-10-142-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Handle BasicObject in drb Also fix a bug in rescue clause of any_to_s because sprintf does not handle the %l modifier. Fixes [Bug #7833] * Do not send a reply to the client if there is a connection error This allows for normal TCP shutdown (fin-ack-fin-ack instead of fin-ack-push-rst). Patch from pierre@mouraf.org (Pierre-Alexandre Meyer). Fixes [Bug #2339] * Detect fork and do not reuse forked connections in drb This associates each DRbConn with a pid, and if the pid changes, it closes any DRbConns in the pool with a pid that no longer matches. This fixes DRb servers from sending messages intended for one client to another client after forking. Fixes [Bug #2718] Fixes [Bug #14471]
* Import StringScanner 1.0.3 (#2553)Sutou Kouhei2019-10-141-70/+170
|
* Import CSV 3.1.2 (#2547)Sutou Kouhei2019-10-126-16/+68
|
* Import REXML 3.2.3 (#2548)Sutou Kouhei2019-10-121-0/+6
|
* test/ruby/test_rubyoptions.rb (test_encoding): skipped on AndroidYusuke Endoh2019-10-111-1/+1
| | | | On Android, nl_langinfo() always returns UTF-8 even when LANG is C.
* test/test_syslog.rb (test_log): skipped on AndroidYusuke Endoh2019-10-111-0/+2
| | | | | On Android 28, LOG_PERROR is defined, but not implemented yet. This change skips Syslog#log explicitly.
* Support delegates for BasicObjectJeremy Evans2019-10-101-0/+8
| | | | | | | | | For BasicObject, bind the Kernel respond_to? instance method to the object and call it instead of calling the method directly. Also, use bind_call(recv, ...) for better performance. Fixes [Bug #16127]