aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
Commit message (Collapse)AuthorAgeFilesLines
* Assert no-block caseNobuyoshi Nakada2019-10-251-2/+11
|
* Set method locationsNobuyoshi Nakada2019-10-251-2/+2
|
* Arguments forwarding is not allowed in lambda [Feature #16253]Nobuyoshi Nakada2019-10-251-0/+2
|
* 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-221-0/+40
|
* 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
|
* 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
* 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
* 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.
* Do not test --jit-debug on -DVM_CHECK_MODETakashi Kokubun2019-10-151-0/+3
|
* Enforce --jit-debug test by another wayTakashi Kokubun2019-10-151-0/+8
|
* 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
|
* 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>. ``
* 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/ruby/test_file_exhaustive.rb: check the owner of the root directoryYusuke Endoh2019-10-101-1/+1
| | | | | The root directory may be owned by the current user, for example, in chroot environment.
* Fixed numbered parameter checkNobuyoshi Nakada2019-10-101-0/+4
| | | | | | * parse.y (struct local_vars): moved numbered parameter NODEs for nesting check to separate per local variable scopes, as numbered parameters should belong to local variable scopes. [Bug #16248]
* Allow ruby2_keywords to be used with bmethodsJeremy Evans2019-10-071-1/+32
| | | | | | | | There are libraries that use define_method with argument splats where they would like to pass keywords through the method. To more easily allow such libraries to use ruby2_keywords to handle backwards compatibility, it is necessary for ruby2_keywords to support bmethods.
* Add: Array#intersection methodPrajjwal Singh2019-10-071-0/+17
|
* Revert "tailcall optimization again (#2528)"Koichi Sasada2019-10-061-13/+0
| | | | This reverts commit f62f90367fc3bce6714e7c34cbd040e14e43fe07.
* tailcall optimization again (#2528)wanabe2019-10-061-0/+13
| | | This is follow up of r67315.
* Treat return in block in class/module as LocalJumpError (#2511)Jeremy Evans2019-10-021-0/+4
| | | | | | return directly in class/module is an error, so return in proc in class/module should also be an error. I believe the previous behavior was an unintentional oversight during the addition of top-level return in 2.4.
* Iseq#to_binary: dump flag for **nil (#2508)Alan Wu2019-10-021-0/+11
| | | | RUBY_ISEQ_DUMP_DEBUG=to_binary and the attached test case was failing. Dump the flag to make sure `**nil` can round-trip properly.
* Fix for wrong fnmatch pattternNobuyoshi Nakada2019-10-011-0/+6
| | | | | * dir.c (file_s_fnmatch): ensure that pattern does not contain a NUL character. https://hackerone.com/reports/449617
* remove `unused var` warningKoichi Sasada2019-10-011-0/+1
|
* Add rb_enumeratorize_with_size_kw and related macrosJeremy Evans2019-09-301-0/+8
| | | | | | | | | | Currently, there is not a way to create a sized enumerator in C with a different set of arguments than provided by Ruby, and correctly handle keyword arguments. This function allows that. The need for this is fairly uncommon, but it occurs at least in Enumerator.produce, which takes arugments from Ruby but calls rb_enumeratorize_with_size with a different set of arguments.
* test/ruby/test_io.rb: supress a "method redefined" warningYusuke Endoh2019-09-301-0/+3
| | | | by explicitly removing the old definition.
* Use assert_operator instead of mere assertNobuyoshi Nakada2019-09-301-2/+2
|
* Now `use_symbol` is always trueNobuyoshi Nakada2019-09-301-2/+2
|
* Emulate method_list (chkbuild) on test-all.Koichi Sasada2019-09-301-0/+41
| | | | | | | chkbuild (CI process) shows methods list before running tests and sometimes it can fails. This commit a code part to emulate this method listing feature.
* Suppress keyword argument warning from #stepNobuyoshi Nakada2019-09-301-0/+8
| | | | | | * numeric.c (num_step): pass the extracted argument from keyword argument, not the last argument itself which should have been warned already.
* Fix warning when doing Struct.new(:x, keyword_init: true){}Jeremy Evans2019-09-271-0/+10
| | | | | | | | | | This is due to calling rb_mod_module_eval directly instead of using rb_funcall_passing_block. The problem with calling directly is it does not create a new VM frame, so rb_mod_module_eval was called with no arguments, but with the keyword given VM frame flag set, which causes problems internally.
* Correctly issue ArgumentError when calling method that accepts no keywordsJeremy Evans2019-09-271-0/+13
| | | | | | | If a method accepts no keywords and was called with a keyword, an ArgumentError was not always issued previously. Force methods that accept no keywords to go through setup_parameters_complex so that an ArgumentError is raised if keywords are provided.
* Drop eliminated catch-entriesNobuyoshi Nakada2019-09-271-0/+15
| | | | | Drop catch table entries used in eliminated block, as well as call_infos. [Bug #16184]
* More tests for [Feature #16150]Nobuyoshi Nakada2019-09-271-0/+21
|
* Fix more keyword separation issuesJeremy Evans2019-09-262-9/+651
| | | | | | | | | | | | | | | | | | | | | This fixes instance_exec and similar methods. It also fixes Enumerator::Yielder#yield, rb_yield_block, and a couple of cases with Proc#{<<,>>}. This support requires the addition of rb_yield_values_kw, similar to rb_yield_values2, for passing the keyword flag. Unlike earlier attempts at this, this does not modify the rb_block_call_func type or add a separate function type. The functions of type rb_block_call_func are called by Ruby with a separate VM frame, and we can get the keyword flag information from the VM frame flags, so it doesn't need to be passed as a function argument. These changes require the following VM functions accept a keyword flag: * vm_yield_with_cref * vm_yield * vm_yield_with_block
* Add compaction support to `rb_ast_t`Aaron Patterson2019-09-261-0/+14
| | | | This commit adds compaction support to `rb_ast_t`.
* Fix keyword argument separation issues in Enumerator::Generator#eachJeremy Evans2019-09-261-0/+77
| | | | This requires adding rb_proc_call_kw to pass the keyword flag.
* Kernel#open may be redefinedNobuyoshi Nakada2019-09-271-2/+13
|
* Fix keyword argument separation issues in Fiber#resumeJeremy Evans2019-09-261-0/+77
|
* Fix keyword argument separation issues in Thread.newJeremy Evans2019-09-261-0/+80
|