aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_refinement.rb
Commit message (Collapse)AuthorAgeFilesLines
* * eval.c (rb_mod_s_used_modules): rename Module.used_refinements toshugo2016-09-081-8/+8
| | | | | | Module.used_modules. [Feature #7418] [ruby-core:49805] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (setclassvariable, setconstant): warn when self is ashugo2016-09-081-0/+16
| | | | | | refinement. [Bug #10103] [ruby-core:64143] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2016-09-071-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_mod_s_used_refinements): new methodshugo2016-09-071-0/+49
| | | | | | | Module.used_refinements. based on the patch by Charlie Somerville. [Feature #7418] [ruby-core:49805] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_refinement.rb: skipshugo2016-06-291-0/+3
| | | | | | | test_prepend_after_refine_wb_miss on ARM or MIPS. [ruby-core:76031] [Bug #12491] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use Integer instead of Fixnum and Bignum.akr2016-05-171-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | * object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c, lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb, lib/rubygems/specification.rb, lib/uri/generic.rb, bootstraptest/test_eval.rb, basictest/test.rb, test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb, test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb, test/csv/test_data_converters.rb, test/date/test_date.rb, test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb, test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb, test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb, test/ruby/test_bignum.rb, test/ruby/test_case.rb, test/ruby/test_class.rb, test/ruby/test_complex.rb, test/ruby/test_enum.rb, test/ruby/test_eval.rb, test/ruby/test_iseq.rb, test/ruby/test_literal.rb, test/ruby/test_math.rb, test/ruby/test_module.rb, test/ruby/test_numeric.rb, test/ruby/test_range.rb, test/ruby/test_rational.rb, test/ruby/test_refinement.rb, test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb, test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb, test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_refinement.rb (test_inspect): Use Integer instead of Fixnum.akr2016-05-021-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: suppress runtime warningsnobu2016-02-191-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53873 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
* * vm_insnhelper.c (vm_call_method_missing): method_missing shouldshugo2015-12-121-0/+25
| | | | | | | not be refined. [ruby-core:72080] [Bug #11809] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (rb_vm_cref_replace_with_duplicated_cref): added.ko12015-11-201-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | CREFs should not be shared by methods between `using'. [Bug #11247] * vm_insnhelper.c (vm_cref_replace_with_duplicated_cref): ditto. * vm.c (vm_cref_dup): should copy refinements correctly. * eval.c: use rb_vm_cref_replace_with_duplicated_cref(). * eval_intern.h: add a decl. of rb_vm_cref_replace_with_duplicated_cref(). * vm_eval.c (eval_string_with_cref): do not need to pass scope's CREF because VM can find out CREF from stack frames. * test/ruby/test_refinement.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_class_clear_method_cache): should clear allko12015-11-181-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | RCLASS_CALLABLE_M_TBLs of all sub-classes (T_ICLASS). RCLASS_CALLABLE_M_TBL() caches complemented method entries. It should be cleared when the modules are cleared. On previous version clears only for direct children. It is enough for normal modules because corresponding T_ICLASSes are direct children. However, refinements create complex data structure. So that we need to clear all children (and descendants). [ruby-core:71423] [Bug #11672] * vm_method.c (rb_clear_method_cache_by_class): rb_mKernel doesn't call rb_class_clear_method_cache, so that clear child T_ICLASSes. * test/ruby/test_refinement.rb: enable disabled test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add a trick to pending for r52509naruse2015-11-101-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add message for assert_equal.akr2015-11-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a test.akr2015-11-091-0/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (move_refined_method): should insert a write barrierko12015-08-311-0/+13
| | | | | | | | | from an original class to a created (cloned) method entry. * test/ruby/test_refinement.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c: typo fix [fix GH-993][ci skip] Patch by @0x0deahsbt2015-08-111-1/+1
| | | | | | * test/ruby/test_refinement.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_alias): should resolve refined methods.shugo2015-05-261-0/+26
| | | | | | [ruby-core:69360] [Bug #11182] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: resolve refined method entrynobu2015-05-081-0/+10
| | | | | | | * vm_eval.c (rb_method_call_status): resolve refined method entry to check if undefined. [ruby-core:69064] [Bug #11117] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: undefined refined check_funcallnobu2015-05-061-0/+17
| | | | | | | * vm_eval.c (rb_method_call_status): undefined refined method is not callable unless using. [ruby-core:69064] [Bug #11117] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (eval_string_with_cref): A binding should keepshugo2015-03-051-16/+23
| | | | | | | | refinements activation information and the refinements should be activated in subsequent eval calls with the binding. [ruby-core:67945] [Bug #10818] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_refinement.rb: There is no need anymore to supressshugo2015-03-051-7/+0
| | | | | | warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (rb_vm_rewrite_cref_stack): copy nd_refinementsktsj2015-02-221-0/+28
| | | | | | | | | | | of orignal crefs. It fixes segmentation fault when calling refined method in duplicate module. [ruby-dev:48878] [Bug #10885] * vm_core.h, class.c: change accordingly. * test/ruby/test_refinement.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method): stop method search when a methodshugo2015-02-101-0/+13
| | | | | | | is not found in a refinement, to support undef in refinements. [ruby-core:66741] [Bug #10578] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (method_entry_i, class_instance_method_list,shugo2015-02-041-0/+25
| | | | | | | rb_obj_singleton_methods): should not include methods of superclasses if recur is false. [ruby-dev:48854] [Bug #10826] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (remove_method): When remove refinedshugo2015-02-031-0/+52
| | | | | | | | | | | | | method, raise a NameError if the method is not defined in refined class. But if the method is defined in refined class, it should keep refined method and remove original method. Patch by Seiei Higa. [ruby-core:67722] [Bug #10765] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c: method defined should not use refinements.nobu2015-01-181-0/+75
| | | | | | | | * vm_method.c (check_definition): Module#public_method_defined?, Module#private_method_defined?, Module#protected_method_defined? should not use refinements. [ruby-core:67656] [Bug #10753] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: singleton_method should not use refinementsnobu2015-01-151-0/+18
| | | | | | | | * proc.c (rb_obj_singleton_method): Kernel#singleton_method should not use refinements, as well as Kernel#method. [ruby-core:67603] [Bug #10744] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c: NameError at refined method aliasnobu2015-01-121-0/+25
| | | | | | | | * vm_method.c (rb_alias): raise a NameError when creating alias to a refined method if the original method of the refined method is not defined. [ruby-core:67523] [Bug #10731] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c: no super klass, no original method entrynobu2015-01-081-0/+13
| | | | | | | * vm_method.c (rb_method_entry): if no super class, no original method entry. [ruby-core:67389] [Bug #10707] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c: fix change refined new method visibilitynobu2015-01-081-0/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49182 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
* vm_insnhelper.c: fix unusable super classnobu2014-08-031-0/+15
| | | | | | | | * vm_insnhelper.c (vm_call_method): unusable super class should cause method missing when BasicObject is refined but not been using. [ruby-core:64166] [Bug #10106] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby: get rid of warnings.usa2014-03-051-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method): should check ci->me->flag ofshugo2014-02-131-0/+45
| | | | | | | | | | | | | | | a refining method in case the method is private. [ruby-core:60111] [Bug #9452] * vm_method.c (make_method_entry_refined): set me->flag of a refined method entry to NOEX_PUBLIC in case the original method is private and it is refined as a public method. The original flag is stored in me->def->body.orig_me, so it's OK to make a refined method entry public. [ruby-core:60111] [Bug #9452] * test/ruby/test_refinement.rb: related tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44931 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
* * vm_insnhelper.c (vm_call_method): set ci->me to 0 when theshugo2013-10-171-0/+48
| | | | | | | | | | | original method of a refined method is undef to avoid SEGV. * vm_method.c (rb_method_entry_without_refinements): return 0 when the original method of a refined method is undef to avoid SEGV. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: assert_raise_with_messagenobu2013-10-091-2/+1
| | | | | | * test/ruby: use assert_raise_with_message git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_undef): raise a NameError if the original methodshugo2013-09-301-0/+44
| | | | | | | | | | of a refined method is not defined. * vm_insnhelper.c (rb_method_entry_eq): added NULL check to avoid SEGV. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* class.c: exclude refined methodsnobu2013-09-101-0/+11
| | | | | | | * class.c (method_entry_i): should exclude refined methods from instance method list. [ruby-core:57080] [Bug #8881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c: clear cache after refine methodnobu2013-09-091-0/+23
| | | | | | | | * vm_method.c (rb_add_refined_method_entry): clear cache in the refined class since refining a method entry is modifying the class. [ruby-core:57079] [Bug #8880] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (vm_call0): fix prototype, the id parameter should be ofcharliesome2013-09-071-0/+21
| | | | | | | | | | | | | | type ID, not VALUE * vm_insnhelper.c (check_match): the rb_funcall family of functions does not care about refinements. We need to use rb_method_entry_with_refinements instead to call === with refinements. Thanks to Jon Conley for reporting this bug. [ruby-core:57051] [Bug #8872] * test/ruby/test_refinement.rb: add test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (eval_string_with_cref): copy cref to limit the scope ofshugo2013-08-061-0/+32
| | | | | | | | refienements in the eval string. [ruby-core:56329] [Bug #8722] * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_mod_refine, mod_using, top_using): don't showshugo2013-07-311-2/+2
| | | | | | | | | | | warnings because Refinements are no longer experimental. [ruby-core:55993] [Feature #8632] * test/ruby/test_refinement.rb: related test. * NEWS: fixes for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_using_module): activate refinements in the ancestors ofshugo2013-07-011-0/+54
| | | | | | | | | the argument module to support refinement inheritance by Module#include. [ruby-core:55671] [Feature #8571] * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (mod_using): new method Module#using, which activatesshugo2013-06-121-8/+57
| | | | | | | | | refinements of the specified module only in the current class or module definition. [ruby-core:55273] [Feature #8481] * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: compare with me in method top cfpnobu2013-02-241-0/+25
| | | | | | | | | * vm_insnhelper.c (vm_call_method): block level control frame does not have method entry, so obtain the method entry from method top-level control frame to be compared with refined method entry. [ruby-core:52750] [Bug #7925] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_eval): enable Refinements by default.shugo2013-01-071-5/+6
| | | | | | | | | | | | | [ruby-core:51286] [Bug #7667] * eval.c (rb_mod_refine, top_using): show a warning when Module#refine or main.using is called at the first time. * ext/refinement/*: removed the extension library "refinement". * test/ruby/test_refinement.rb: fix for the above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2012-12-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_prepend_module): move refined methods from the originshugo2012-12-121-0/+45
| | | | | | | | | of a class to the class, because refinements should have priority over prepended modules. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e