summaryrefslogtreecommitdiffhomepage
path: root/test
AgeCommit message (Collapse)Author
2019-07-30Refine message to `skip` in nested `assert`KOBAYASHI Shuji
- I think "Info" is used only to `skip`, so change to "Skip". - Changed the default value of `assert` and specify the argument explicitly at the caller of `assert` because it is unnatural "Assertion failed" is output even though the assertion doesn't fail. == Example: def assert_foo(exp, act) assert do assert_equal exp[0], act[0] assert_equal exp[1], act[1] end end def assert_bar(exp, act) assert do skip end end def assert_baz(exp, act) assert do assert_equal exp, act assert_bar exp, act end end assert 'test#skip_in_nested_assert' do assert_baz 1, 1 end === Before this patch: ?.. Info: test#skip_in_nested_assert (core) - Assertion[1] Info: Assertion failed (core) - Assertion[1-2] Skip: Assertion failed (core) Total: 3 OK: 2 KO: 0 Crash: 0 Warning: 0 Skip: 1 === After this patch: ??? Skip: test#skip_in_nested_assert (core) - Assertion[1] Skip: assert (core) - Assertion[1-2] Skip: assert (core) Total: 3 OK: 0 KO: 0 Crash: 0 Warning: 0 Skip: 3
2019-07-29Fix "Warn if assertion is missing inside `assert`"; ref ff43b2b9KOBAYASHI Shuji
2019-07-29Fixed a conflict between #4407 and #4540Yukihiro "Matz" Matsumoto
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-07-29Resolved conflicts in #4320Yukihiro "Matz" Matsumoto
2019-07-20Fix `Module#dup` to frozen moduleKOBAYASHI Shuji
Before this patch: $ bin/mruby -e 'p Module.new.freeze.dup.frozen?' #=> true After this patch (same as Ruby): $ bin/mruby -e 'p Module.new.freeze.dup.frozen?' #=> false
2019-07-18Fix `String#*` test with `MRB_WITHOUT_FLOAT`KOBAYASHI Shuji
2019-07-17Fix `String#[]` testKOBAYASHI Shuji
2019-07-17Merge branch 'master' into i110/inspect-recursionYukihiro "Matz" Matsumoto
2019-07-13`Enumerable#detect` {and `#find`} should call `ifnone`; fix #4484Yukihiro "Matz" Matsumoto
It's an error in ISO specification; 15.3.2.2.4 and 15.3.2.2.7
2019-07-11Add UTF-8 test for `String#index`dearblue
2019-07-09Fix the order of "expected" and "actual" in `test/t/range.rb`KOBAYASHI Shuji
2019-07-07Fix `Numeric#step` to infinity; ref. #4555KOBAYASHI Shuji
2019-06-30Fix `include`, `prepend` and `extend` to frozen objectKOBAYASHI Shuji
2019-06-29Merge pull request #4540 from dearblue/assert-nestingYukihiro "Matz" Matsumoto
Nested `assert` for mrbtest
2019-06-29Add test for `String#[]=`dearblue
2019-06-29Nested `assert` for mrbtestdearblue
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`.
2019-06-28Use `__ENCODING__` in testsKOBAYASHI Shuji
It cannot be used for `String#size` test if judging whether or not `MRB_UTF8_STRING` is defined by result of `String#size`.
2019-06-27Add modification tests for immediate valueKOBAYASHI Shuji
2019-06-22Add test for one UTF-8 charactordearblue
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-10Merge pull request #4495 from shuujii/remove-Kernel-global_variables-from-coreYukihiro "Matz" Matsumoto
Remove `Kernel#global_variables` from core
2019-06-09Fix missing assertions in `test/t/syntax.rb`KOBAYASHI Shuji
2019-06-08Remove "Check the usage of a NUL character" testKOBAYASHI Shuji
Because there is not assertion in this test and NUL character literal is used in other tests.
2019-06-07Remove `Kernel#global_variables` from coreKOBAYASHI Shuji
This method is defined in `mruby-metaprog` gem.
2019-06-05Fix missing assertions in `test/t/module.rb`KOBAYASHI Shuji
2019-05-27Use `$undefined.equal?(obj2)` instead of `obj2 == $undefined` in `assert.rb`KOBAYASHI Shuji
In case `obj2.==` is broken.
2019-05-15Merge pull request #4400 from ↵Yukihiro "Matz" Matsumoto
shuujii/fix-name-assignment-to-frozen-anonymous-class-module Fix name assignment to frozen anonymous class/module
2019-05-03Simplify conversion process for `i` in `mrb_get_args()`KOBAYASHI Shuji
2019-04-29Refine the default values of `flunk`KOBAYASHI Shuji
The default message for the second argument should be set to the first argument because only one argument is normally specified.
2019-04-26Add `assert_raise_with_message` and `assert_raise_with_message_pattern`KOBAYASHI Shuji
2019-04-25Singleton class of frozen object should be frozenKOBAYASHI Shuji
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
2019-04-24Fix modiying class variable to frozen class/moduleKOBAYASHI Shuji
2019-04-23Fix "ambiguous first argument" warning in `test/t/float.rb`KOBAYASHI Shuji
2019-04-23Fix name assignment to frozen anonymous class/moduleKOBAYASHI Shuji
Fix the following issues: A = Class.new.freeze #=> FrozenError Module.new::B = Class.new.freeze #=> FrozenError String::B = Module.new.freeze #=> FrozenError
2019-04-22Merge pull request #4356 from shuujii/add-assert_match-and-assert_not_matchYukihiro "Matz" Matsumoto
Add `assert_match` and `assert_not_match`
2019-04-22Add `assert_predicate` and `assert_operator`KOBAYASHI Shuji
2019-04-21Commented out `String#scan` because it is not implemented yetKOBAYASHI Shuji
2019-04-19Add type check (conversion) in `String#[]=`KOBAYASHI Shuji
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
2019-04-14Add `assert_match` and `assert_not_match`KOBAYASHI Shuji
2019-04-12Refine `assert_float`KOBAYASHI Shuji
Avoid arithmetic operations when `exp` and/or `act` are infinity or NaN.
2019-04-10Use `mrb_immediate_p()` in `mrb_obj_freeze()` and `mrb_obj_frozen()`KOBAYASHI Shuji
2019-04-07Fix test for `Array#slice`KOBAYASHI Shuji
2019-04-05`Module#alias_method` should return `self` in ISO standardKOBAYASHI Shuji
2019-03-31Fix warning: '*' interpreted as argument prefixKOBAYASHI Shuji
2019-03-30Add `pass` and `flunk` to `test/assert.rb`KOBAYASHI Shuji
2019-03-26Fix dealing with infinity and NaN in `test/assert.rb:assert_float`KOBAYASHI Shuji
`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.
2019-03-25Remove implementation of `Symbol#===`KOBAYASHI Shuji
For reducing program size.
2019-03-25Update float test values to avoid precision errors.Yukihiro "Matz" Matsumoto