Project

General

Profile

Feature #14142 ยป add_method_eqq.patch

osyo (manga osyo), 11/29/2017 12:24 PM

View differences:

proc.c
3124 3124
    rb_define_method(rb_cMethod, "hash", method_hash, 0);
3125 3125
    rb_define_method(rb_cMethod, "clone", method_clone, 0);
3126 3126
    rb_define_method(rb_cMethod, "call", rb_method_call, -1);
3127
    rb_define_method(rb_cMethod, "===", rb_method_call, -1);
3127 3128
    rb_define_method(rb_cMethod, "curry", rb_method_curry, -1);
3128 3129
    rb_define_method(rb_cMethod, "[]", rb_method_call, -1);
3129 3130
    rb_define_method(rb_cMethod, "arity", method_arity_m, 0);
test/ruby/test_method.rb
1017 1017
    # without trace insn
1018 1018
    assert_separately [], "RubyVM::InstructionSequence.compile_option = {trace_instruction: false}\n" + body
1019 1019
  end
1020

  
1021
  def test_eqq
1022
    assert(Method.instance_methods(false).include? :===)
1023
    assert_operator(0.method(:<), :===, 5)
1024
    assert_not_operator(0.method(:<), :===, -5)
1025
  end
1020 1026
end