Based on minitest RubyGem.
Example of before this patch:
- Assertion[1] Failed: Expected 1 to be 2
Expected: 2
Actual: 1
- Assertion[2] Failed: Expected [1, 3] to include 2
Collection: [1, 3]
Object: 2
Example of after this patch:
- Assertion[1]
Expected: 2
Actual: 1
- Assertion[2]
Expected [1, 3] to include 2.
For the following reasons:
- Previous behavior is confusable because it's different from test/unit rubygem's `assert_true`
- Tests may pass unintentionally in an inappropriate way; ref #4285#4287
Include the following changes too:
- Extract part of logic with block to a method
- Use `var ||= ...` instead of `var = ... unless var`
- Unify using parentheses for `t_print`
- Change methods order
[Breaking changes]
Developers must use following APIs for accessing attributes of RRange
because RRange structure depends on boxing setting.
- mrb_range_beg
- mrb_range_end
- mrb_range_excl_p
This assertion is accidentaly passed because `send` was removed from mruby
core so `NoMethodError` is raised and `NoMethodError` is subclass of
`NameError`.
We have added internal convenience method `__to_str` which
does string type check.
The issue #3854 was fixed but fundamental flaw of lack of stack
depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA`
for workaround.
Even though `Symbol#to_proc` is not included in ISO standard, the
`some_method(&:method_name)` is used very widely and convenient.
So we moved it to the core.
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.