summaryrefslogtreecommitdiffhomepage
path: root/test/t/kernel.rb
AgeCommit message (Collapse)Author
2021-11-26test/kernel.rb: remove duplicate tests; ref #5584Yukihiro "Matz" Matsumoto
2021-11-26Check more `MRB_ARGS_NONE()`dearblue
The `__id__` method implemented in the C function has `MRB_ARGS_NONE()` specified, but it is also effective in the following cases. ```ruby p nil.__id__ opts: 1 rescue p :a p nil.method(:__id__).call 1 rescue p :b p nil.method(:__id__).call opts: 1 rescue p :c p nil.method(:__id__).to_proc.call 1 rescue p :d p nil.method(:__id__).to_proc.call opts: 1 rescue p :e p nil.method(:__id__).unbind.bind_call nil, 1 rescue p :f p nil.method(:__id__).unbind.bind_call nil, opts: 1 rescue p :g p nil.__send__ :__id__, 1 rescue p :h p nil.__send__ :__id__, opts: 1 rescue p :i ``` After applying this patch, all items will output symbols in the same way as CRuby. For this purpose, add `MRB_PROC_NOARG` to `struct RProc::flags`.
2021-04-01vm.c: change the default error message for undefined `super` method.Yukihiro "Matz" Matsumoto
- (old) `undefined method 'foo'` - (new) `no superclass method 'foo'`
2020-10-12Integrate `Fixnum` class into `Integer` classdearblue
* The `Fixnum` constant is now an alias for the `Integer` class. * Remove `struct mrb_state::fixnum_class` member. If necessary, use `struct mrb_state::integer_class` instead.
2020-07-16Fixed shift width for `MRB_ENV_SET_BIDX()`dearblue
ref c07f24cd1 and close #5035
2020-06-09Update `test/t/kernel.rb`dearblue
- Remove unnecessoury assert - Fix typo
2020-05-24Do not destruct rest arguments for __send__Yusuke Endoh
Formerly, `__send__(*args)` modified `args` with `Array#shift`. This bug affects optcarrot. This changeset avoids the array destruction by using `args = args[1, len-1]`.
2020-04-21`Kernel#clone` and `Kernel#dup` no longer raise `TypeError`; fix #4974Yukihiro "Matz" Matsumoto
In ISO, those methods should raise `TypeError`, but the spec has been changed. The change was discussed in [Feature#12979].
2019-07-29Merge pull request #4407 from ↵Yukihiro "Matz" Matsumoto
shuujii/add-assert_raise_with_message-and-assert_raise_with_message_pattern Add `assert_raise_with_message` and `assert_raise_with_message_pattern`
2019-06-30Fix `include`, `prepend` and `extend` to frozen objectKOBAYASHI Shuji
2019-06-27Add modification tests for immediate valueKOBAYASHI Shuji
2019-06-21Move `Kernel#__send__` test to core from `mruby-metaprog`KOBAYASHI Shuji
2019-06-16Fix cvar, ivar, const and method can be removed to frozen objectKOBAYASHI Shuji
2019-06-07Remove `Kernel#global_variables` from coreKOBAYASHI Shuji
This method is defined in `mruby-metaprog` gem.
2019-04-26Add `assert_raise_with_message` and `assert_raise_with_message_pattern`KOBAYASHI Shuji
2019-04-10Use `mrb_immediate_p()` in `mrb_obj_freeze()` and `mrb_obj_frozen()`KOBAYASHI Shuji
2019-03-17Fix class/instance variable name validationKOBAYASHI Shuji
- `@@?` etc are invalid class variable name. - `@1` etc are invalid instance variable name.
2018-09-07Clear terminated spacedearblue
2018-09-01Move `Kernel#send` to `mruby-metaprog` gem.Yukihiro "Matz" Matsumoto
But `BasicObject#__send__` is still available from the core.
2018-08-30Separate meta-programming features to `mruby-metaprog` gem.Yukihiro "Matz" Matsumoto
We assume meta-programming is less used in embedded environments. We have moved following methods: * Kernel module global_variables, local_variables, singleton_class, instance_variables, instance_variables_defined?, instance_variable_get, instance_variable_set, methods, private_methods, public_methods, protected_methods, singleton_methods, define_singleton_methods * Module class class_variables, class_variables_defined?, class_variable_get, class_variable_set, remove_class_variable, included_modules, instance_methods, remove_method, method_removed, constants * Module class methods constants, nesting Note: Following meta-programming methods are kept in the core: * Module class alias_method, undef_method, ancestors, const_defined?, const_get, const_set, remove_const, method_defined?, define_method * Toplevel object define_method `mruby-metaprog` gem is linked by default (specified in default.gembox). When it is removed, it will save 40KB (stripped:8KB) on x86-64 environment last time I measured.
2018-06-01The `clone` method should copy object status (e.g. frozen) too; #4030Yukihiro "Matz" Matsumoto
2017-12-23Update `Kernel#method_missing` tests for new `NoMethodError` message.Yukihiro "Matz" Matsumoto
Also removed tests that depends on implementation details of the default `method_missing` behavior.
2017-10-28Update test for `Kernel#local_variables`Yukihiro "Matz" Matsumoto
2017-08-11Added basic test for calling a missing method through superChristopher Aue
2017-06-28Remove redundant use of `Object#to_s` in interpolation.Yukihiro "Matz" Matsumoto
2017-02-06Kernel#local_variables: Make result array uniqueksss
2016-12-25Fix segv when primitive valueksss
Fix #3352
2016-12-11Implement Object#freezeTakashi Kokubun
2016-12-01Use mrb_ptr instead of mrb_cptr in Kernel#to_sBouke van der Bijl
This is to avoid segfault when WORD_BOXING is enabled Reported by https://hackerone.com/brakhane
2016-11-24Copy over INSTANCE_TT when duping classBouke van der Bijl
2016-06-18add test for public_methods(false)Yasuhiro Matsumoto
2014-06-01remove part of 9cd71916 test for same reason as 5306e47Yukihiro "Matz" Matsumoto
2014-05-19Move `Kernel.local_variables` to core.take_cheeze
2014-05-18Add test for remove_instance_variableCarson McDonald
2014-05-16Fix #2259 .take_cheeze
2014-05-09Move `__method__` to mruby-kernel-ext since it's not ISO method.take_cheeze
2014-03-28Implement Kernel#define_singleton_methodksss
2014-03-27Implement Kernel#__method__ksss
2014-02-27Refactor tests in kernel.rbJun Hiroe
2014-02-26add test for Kernel#instance_variable_defined?cubicdaiya
2014-02-09Fix Kernel#global_variables for $1-$9Pavel
2014-01-10add operator "!~".Tomoyuki Sahara
2014-01-04object_id may not return Fixnum (ISO says Integer), since intptr_t may be ↵Yukihiro "Matz" Matsumoto
bigger than Fixnum, so type check for Numeric; ref #1630
2014-01-01return value from #object_id may not be Fixnum; ref #1630Yukihiro "Matz" Matsumoto
2014-01-01successful recursion check to be shallower; ref #1630Yukihiro "Matz" Matsumoto
2013-12-31Method missing and inspect testsCarson McDonald
2013-12-31Test coverage of extending stack and overflowCarson McDonald
2013-12-31More object_id test coverageCarson McDonald
2013-12-04Add is_a? test to cover issue 1477Carson McDonald
2013-08-02I fix order of actual and expect test value in kernel.rb.Jun Hiroe