Commit 63a56ddd authored by Masaki Muranaka's avatar Masaki Muranaka

Add String#dump method.

parent cdd41a33
......@@ -21,7 +21,8 @@ mrb_mruby_string_ext_gem_init(mrb_state* mrb)
{
struct RClass * s = mrb->string_class;
mrb_define_method(mrb, s, "getbyte", mrb_str_getbyte, ARGS_REQ(1));
mrb_define_method(mrb, s, "dump", mrb_str_dump, ARGS_NONE());
mrb_define_method(mrb, s, "getbyte", mrb_str_getbyte, ARGS_REQ(1));
}
void
......
......@@ -13,3 +13,6 @@ assert('String#getbyte') do
assert_equal bytes2[0], str2.getbyte(0)
end
assert('String#dump') do
"foo".dump == "\"foo\""
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment