take-cheeze/mruby-msgpack — pull request #1 by schmurfy (2013-07-30 14:54:18+00:00)
Title: Basic type tests

What I did was reuse a minimal test framework (that's three methods xD) I used on one my mruby gem and add some tests for it in the specs folder.

The main reason is that you just have ti run rake in the mruby-pack folder and you get the test results some seconds later where running "rake test" is the mruby folder:
- is tedious
- takes a long time
- is not really verbose on what passed or
- does not show a trace of where exactly the assertion failed

The commented lines in the specs file are the failing ones, if you are fine with this way of doing tests I can add more. The code isn't that readable so I will let you make the tests pass, you also need to check which types are available depending of the size of mrb_value, I think by default it is 32bits but you can define MRB_INT64 or MRB_INT16 to change this.

Some "#if defined" should be used to not attempt to decode an integer type we can't fit into a mrb_int, similarily we won't be able to store a uint64 or at least not in an mrb_int since int64 is the biggest we got.