• dearblue's avatar
    Nested `assert` for mrbtest · 5f9034e4
    dearblue authored
    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`.
    5f9034e4
assert.rb 9.66 KB