| Age | Commit message (Collapse) | Author |
|
|
|
|
|
Nested `assert` for mrbtest
|
|
|
|
When nesting `assert` used in test, it is indented and displayed.
Assertion numbers are concatenated by `"-"` at this time.
The purpose is to match the apparent numbers when failing with `assert_mruby`
which is defined by `mrbgems/mruby-bin-mruby/bintest/mruby.rb` for example.
Child assertions "skip" and "info" are reported as parent assertions "info"
and `$ok_test += 1`. The child assertions "ko" and "crash" are reported as the
parent assertion "ko" and `$ko_test += 1`.
When child assertions are mixed, "ko" takes precedence.
Incompatibility:
- `$mrbtest_assert_idx` takes `nil` or an integer array object.
So far it was `nil` or an integer.
- `$asserts` points to the top of the internal stack in the `assert`.
- `$mrbtest_assert` points to the top of the internal stack in `assert`.
|
|
It cannot be used for `String#size` test if judging whether or not `MRB_UTF8_STRING` is defined by result of `String#size`.
|
|
|
|
|
|
|
|
|
|
Remove `Kernel#global_variables` from core
|
|
|
|
Because there is not assertion in this test and NUL character literal is
used in other tests.
|
|
This method is defined in `mruby-metaprog` gem.
|
|
|
|
In case `obj2.==` is broken.
|
|
shuujii/fix-name-assignment-to-frozen-anonymous-class-module
Fix name assignment to frozen anonymous class/module
|
|
|
|
The default message for the second argument should be set to the first
argument because only one argument is normally specified.
|
|
|
|
Before this patch:
p (class << Object.new.freeze; self end).frozen? #=> false
sc = class << (o=Object.new); self end; o.freeze; p sc.frozen? #=> false
After this patch / Ruby:
p (class << Object.new.freeze; self end).frozen? #=> true
sc = class << (o=Object.new); self end; o.freeze; p sc.frozen? #=> true
|
|
|
|
|
|
Fix the following issues:
A = Class.new.freeze #=> FrozenError
Module.new::B = Class.new.freeze #=> FrozenError
String::B = Module.new.freeze #=> FrozenError
|
|
Add `assert_match` and `assert_not_match`
|
|
|
|
|
|
Before this patch:
'a'[0] = 1 #=> 1
'a'[:a] = '1' #=> ArgumentError
'a'[:a, 0] = '1' #=> ArgumentError
'a'[0, :a] = '1' #=> ArgumentError
'a'[0, 1] = 1 #=> 1
After this patch / Ruby:
'a'[0] = 1 #=> TypeError
'a'[:a] = '1' #=> TypeError
'a'[:a, 0] = '1' #=> TypeError
'a'[0, :a] = '1' #=> TypeError
'a'[0, 1] = 1 #=> TypeError
|
|
|
|
Avoid arithmetic operations when `exp` and/or `act` are infinity or NaN.
|
|
|
|
|
|
|
|
|
|
|
|
`assert_float` is always passed when expected value and/or actual value are
infinity or NaN. This behavior seems unintentional.
Before this patch:
assert_float(Float::INFINITY, 1.0) #=> pass
assert_float(-Float::INFINITY, 1) #=> pass
assert_float(1, 1/0) #=> pass
assert_float(1, -1/0) #=> pass
assert_float(1.0, Float::NAN) #=> pass
assert_float(Float::NAN, 1) #=> pass
After this patch:
assert_float(Float::INFINITY, 1.0) #=> fail: Expected 1.0 to be Infinity.
assert_float(-Float::INFINITY, 1) #=> fail: Expected 1 to be -Infinity.
assert_float(1, 1/0) #=> fail: Expected Infinity to be 1.
assert_float(1, -1/0) #=> fail: Expected -Infinity to be 1.
assert_float(1.0, Float::NAN) #=> fail: Expected NaN to be 1.0.
assert_float(Float::NAN, 1) #=> fail: Expected 1 to be NaN.
|
|
For reducing program size.
|
|
|
|
|
|
|
|
|
|
shuujii/remove-redundant-content-in-assertion-failure-message-and-diff
Remove redundant content in assertion failure message and diff
|
|
|
|
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.
|
|
|
|
- `@@?` etc are invalid class variable name.
- `@1` etc are invalid instance variable name.
|
|
Fix constant name validation
|
|
|
|
`X!` etc are invalid constant name.
|
|
- An exception do not raise when mrbtest fail.
- There are no useful informations in exception message and backtrace.
|