This articles was published on 2013-07-04

[June 2013] mruby news

What happened on the mruby front in June 2013?

Test Refactoring

The mruby internal test system was till now quite simple. Every assertion was checked based on the return value. Due to that the test code contained a lot of helper variables and binary concatenations to validate the proper test results. After we have introduced many more advanced assertions (i.e. assert_raise) we refactored the core test code and have now a much cleaner test environment with much less overhead due to the non existing restriction anymore of the return value.

Return Code Refactoring

Jun Hiroe worked hard on refactoring the return values of several internal C functions by using explicit mruby boolean types instead of integers as the return value.

New Object Extension GEM

Akira Yumiyama introduced the new gem mruby-object-ext which contains the following object extensions:

  • nil#to_a
  • nil#to_f
  • nil#to_i

Improve Target Specific Code

kyab and cremno improved platform dependent build instructions and code. Mainly for building on Visual Studio and building for Arduino (i.e. ChipKit).

Commits

Here a list with all commits during this month.

Test Refactoring

Add Range#eql? method test.

Add block mode to assert_equal

Implement assert_float and add block mode to assert_equal and assert_not_equal

Add undef var test

Improve String Tests

Improve Module Tests

Improve Kernel Tests

Improve Hash Tests

Improve Literal Tests

Improve Integer Tests

Improve Range Tests

Improve Syntax Tests

assert_not_equal can now also handle blocks

Fix Bootstrap Block Tests with assert_nil

Improve RuntimeError Tests

Improve TypeError Tests

Improve true Tests

Improve Symbol Tests

Improve StandardError Tests

Improve RangeError Tests

Improve Proc Tests

Improve Object Tests

Improve Numeric Tests

Improve NoMethodError Tests

Improve nil Tests

Improve NameError Tests

Improve LocalJumpError Tests

Improve IndexError Tests

Improve GC Tests

Improve Float Tests

Add assert_float to test environment

Improve Bootstrap Literal Tests

Improve Bootstrap Block Tests

Improve false tests

Improve Exception tests

Improve Enumerable tests

Add assert_not_include to test environment

Improve Comparable tests

Improve Class tests

Improve BasicObject tests

Fix Array Tests

Improve Array tests

Add assert_not_equal

Improve ArgumentError tests

Improve alias tests

Improve undef tests

Return Code Refactoring

Refactor range_eql() func in rangec.c

Refactor mrb_range_eq() func in range.c.

Refactor mrb_obj_eq() func in object.c.

refactor mrb_realloc()

Refactor mrb_hash_empty_p() func in hash.c

Refactor mrb_hash_has_keyWithKey() func in hash.c

New Object Extension GEM

add nil.to_a, nil.to_f, nil.to_i methods

Improve Target Specific Code

include inttypes.h if _MSC_VER is not defined

Fix include path of ArduinoDue example

Visual Studio 2013 support + strtof + inline

Improve target example to more practical.

Fix and refactor crossbuild target config

No need to specify empty bin list anymore(example)

Others

Change int to size_t

Change int to size_t.

Fix some signed unsigned warnings, int to size_t.

Fix Range#==

replaced POSIX header with standard C header

fix unnecessary exception in mrb_get_args with “z” format.

Avoid read_escape() in case of regexp

Add arena save/restore around use of hash KEY.

use mrb_malloc_simple() to allocate crc buffer; close #1302

add mrb_malloc_simple() that returns NULL on error

Fix crash on load *mrb

fixed a bug in push back list; close #1298

Add fallback for allocate CRC buffer

Cleanup mrb_str_resize().

make mrb_str_new_cstr DRY

Fix compile warning for abort

fix typo: Tus -> Tue.

Remove extra separator in compile command

Fix float parenthese warning

Change seperator to separator

fix indent

Check parameters strictly.

add assertion that check sizeof(void*) should be 4 bytes when MRB_NAN_BOXING is in use

restructure header files; move non config lines away from mrbconf.h

Use casting instead of a macro

Replace isupper with a macro in msvc

Remove incorrect removal of iv

Singleton raises TypeError on #new

Raise a NameError when symbol isn’t found.

bob doesn’t have new so don’t undef

new is removed from Integer so doesn’t need to be removed again in Fixnum

install gperf to prevent accidental compile error

do not specify implementation dependant exception class names in fiber test

Describe GemBox files can be located anywhere

Minor wording changes and a couple spelling fixes