aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_proc.rb
Commit message (Collapse)AuthorAgeFilesLines
* test/ruby: suppress parser warningsnobu2016-02-191-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix test to follow r53503naruse2016-01-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c: fix mark miss for proc given as passed block.ko12015-12-161-0/+20
| | | | | | | | | | | | | | | | | | [Bug #11750] * vm.c (vm_make_proc_from_block): should return a Proc object if block is given. Previous implementation returns a Proc object only when corresponding Proc object is not available. * vm.c (vm_make_env_each): ditto. * test/ruby/test_proc.rb: add a test for this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_proc.rb: test_curry_bindingnobu2015-03-291-1/+1
| | | | | | | * test/ruby/test_proc.rb (test_curry_binding): rename test_binding2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_proc.rb: Fix typo signle -> singlegogotanaka2015-03-151-1/+1
| | | | | | [fix GH-852][ci skip] Patch by @hanachin git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: fix method proc binding locationnobu2014-11-161-0/+7
| | | | | | | * proc.c (proc_binding): use the original iseq on a binding from proc from method object to get the location. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/lib/envutil.rb: Moved from test/ruby/.akr2014-11-131-1/+0
| | | | | | | | | | | | | | * test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: fix method proc binding receivernobu2014-10-271-1/+4
| | | | | | | | * proc.c (method_proc): the receiver of binding from method should be same as the receiver of the method. [ruby-core:65917] [Bug #10432] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c: rb_vm_env_local_variablesnobu2014-07-011-1/+3
| | | | | | | | * vm.c (rb_vm_env_local_variables): returns array of local variable name symbols in the environment by envval. * proc.c (bind_local_variables): use rb_vm_env_local_variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: Binding#receivernobu2014-07-011-0/+10
| | | | | | | * proc.c (bind_receiver): new method to return the bound receiver of the binding object. [ruby-dev:47613] [Feature #8779] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: fix infinite loopnobu2014-07-011-0/+5
| | | | | | | * proc.c (bind_local_variables): update env from envval for each iterations. [ruby-dev:48351] [Bug #10001] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_proc.rb: test_local_variablesnobu2014-07-011-0/+5
| | | | | | | * test/ruby/test_proc.rb (test_local_variables): missing test for Binding#local_variables. [Feature #8773] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_proc.rb: test_local_variables_in_other_contextnobu2014-07-011-0/+10
| | | | | | | | * test/ruby/test_proc.rb (test_local_variables_in_other_context): move from test_variable.rb, this is a test for the method of Binding, not of Kernel. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: fix leaked threadsnobu2014-05-261-0/+1
| | | | | | | * test/thread/test_{backtrace,beginendblock,proc,threadgroup}.rb: join work threads not to leak threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c: Having any mandatory keyword argument increases min arity [#9299]marcandre2013-12-251-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c: Having optional keyword arguments makes maximum arity +1, not ↵marcandre2013-12-251-6/+6
| | | | | | unlimited [#8072] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: fix parameter of unnamed rest keywords argumentnobu2013-12-251-0/+14
| | | | | | | * iseq.c (rb_iseq_parameters): push argument type symbol only for unnamed rest keywords argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: fix arity of rest keywords argumentnobu2013-12-251-0/+18
| | | | | | | * proc.c (rb_iseq_min_max_arity): maximum argument is unlimited if having rest keywords argument. [ruby-core:53298] [Bug #8072] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_method.rb, test_proc.rb: suppress warningsnobu2013-12-251-1/+1
| | | | | | | | * test/ruby/test_method.rb: suppress warnings in verbose mode. * test/ruby/test_proc.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typo in testsa_matsuda2013-12-201-2/+2
| | | | | | | * test/ruby/test_proc.rb: s/overriden/overridden/ * test/ruby/test_refinement.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: better assertionsnobu2013-12-131-1/+1
| | | | | | * test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c: add Binding#local_variable_get/set/defined?ko12013-08-091-0/+34
| | | | | | | | | | | | to access local variables which a binding contains. Most part of implementation by nobu. * test/ruby/test_proc.rb: add a tests for above. * vm.c, vm_core.h (rb_binding_add_dynavars): add a new function to add a new environment to create space for new local variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_proc.rb (TestProc#test_block_given_method_to_proc):ktsj2013-06-171-1/+0
| | | | | | run test for r41359. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h, proc.c (rb_method_call_with_block):ktsj2013-06-171-1/+0
| | | | | | | | | | | | | new function to invoke a Method object with a block passed as an argument. * proc.c (bmcall): use the above function to avoid a block sharing. [ruby-core:54626] [Bug #8341] * test/ruby/test_proc.rb (TestProc#test_block_persist_between_calls): run related tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* skip new tests until fixednobu2013-06-171-0/+2
| | | | | | | * test/ruby/test_proc.rb, test/ruby/test_symbol.rb: skip new tests until fixed, for the time being. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_proc.rb: tests for [Bug #8341]nobu2013-06-171-0/+39
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: frozen core methodsnobu2013-04-301-0/+11
| | | | | | | | | * proc.c (mproc, mlambda): use frozen core methods instead of plain global methods, so that methods cannot be overridden. [ruby-core:54687] [Bug #8345] * vm.c (Init_VM): define proc and lambda on the frozen core object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (proc_curry): Fix arity check [Bug #5747]marcandre2013-02-011-0/+7
| | | | | | * test/ruby/test_proc.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c: Add {*}_min_max_arity and refactor.marcandre2013-02-011-1/+1
| | | | | | | | [Bug #7765] * test/ruby/test_proc.rb: Fix wrong test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: no splat single opt argnobu2012-12-281-0/+16
| | | | | | | | * vm_insnhelper.c (vm_yield_setup_block_args): pass single argument to single optional parameter unchanged without splatting. [Bug #7621] [ruby-dev:46801] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress warningsnaruse2012-12-191-11/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c: remove Proc#== and Proc#eql?.ko12012-11-281-6/+0
| | | | | | | | | Proc objects compared with thier object ids. * test/ruby/test_proc.rb: remove related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add test for instance_exec receiving a curried proc.tenderlove2012-10-231-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add tests for r36415.naruse2012-07-171-0/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert of r36411, as does not distinguish proc from lambdamarcandre2012-07-161-1/+0
| | | | | | | * proc.c (rb_proc_arity): Fix Proc#arity in case of optional arguments [bug #5694] [rubyspec:b8b259] [rubyspec:184c8100f] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r33924.marcandre2012-07-161-0/+1
| | | | | | | * proc.c (rb_proc_arity): Fix Proc#arity in case of optional arguments [bug #5694] [rubyspec:b8b259] [rubyspec:184c8100f] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (primary): remove wrong "fixpos" that caused incorrectmame2012-04-231-0/+14
| | | | | | | | source_location of blocks. [ruby-core:42232] [Bug #5930] * test/ruby/test_proc.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_yield_setup_block_args): splat singlenobu2011-12-121-0/+273
| | | | | | | | argument if optinal arguments are defined not only mandatory or post arguments. [ruby-core:41557] [Bug #5730] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_proc.rb (TestProc): renamed argument tests.nobu2011-12-101-13/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (check_funcall): try respond_to? first if redefined.nobu2011-08-051-1/+1
| | | | | | [Bug #5158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (sym_call), vm.c (invoke_block_from_c),nobu2010-09-241-0/+18
| | | | | | | | | | vm_insnhelper.c (vm_yield_with_cfunc): pass given block. [ruby-core:32075] * vm_eval.c (rb_funcall_passing_block): new function to call method with passing given block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (rb_thread_method_id_and_class): curried proc has nonobu2010-08-291-0/+8
| | | | | | method. [ruby-core:31871] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_proc.rb (test_parameters): require is no longer built-in.nobu2010-06-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby: fixed nonsense assertions.nobu2010-04-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a test.wanabe2010-03-221-0/+25
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* avoid method redefinition.akr2010-02-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* supress warnings.akr2010-01-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb: add a test for Array#rotate, rotate!.mame2010-01-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/ruby/test_dir.rb, test/ruby/test_fnmatch.rb: add some tests (for coverage of dir.c). * test/ruby/test_enum.rb: add a test for Enumerable#minmax. * test/ruby/test_enumerator.rb: add some tests for Enumerator#inspect, Enumerator::Generator and Yielder. * test/ruby/test_env.rb: add a test for ENV#index. * test/ruby/test_exception.rb: add some tests (for coverage of error.c). * test/ruby/test_hash.rb: add a test for recursive check. * test/ruby/test_integer.rb: add a test for number of argument of Integer. * test/ruby/test_method.rb: add a test for define_method. * test/ruby/test_module.rb: add a test for constant of included module. * test/ruby/test_proc.rb: add a test for parameters with cfunc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (k_def): adjust the location of method definition to thenobu2009-12-041-3/+4
| | | | | | | line of def. [Bug #2427] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e