1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00

mruby: freeze ntoa results

This commit is contained in:
Alex Kotov 2022-02-03 14:44:51 +05:00
parent 4c4fdeee2c
commit cdc0a02a45
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 8 additions and 8 deletions

View file

@ -59,7 +59,7 @@ mrb_value rb_KernAux_utoa(mrb_state *mrb, mrb_value self)
mrb_value result = mrb_str_new_lit(mrb, "");
result = mrb_str_cat_cstr(mrb, result, buffer);
return result;
return mrb_obj_freeze(mrb, result);
}
mrb_value rb_KernAux_itoa(mrb_state *mrb, mrb_value self)
@ -75,7 +75,7 @@ mrb_value rb_KernAux_itoa(mrb_state *mrb, mrb_value self)
mrb_value result = mrb_str_new_lit(mrb, "");
result = mrb_str_cat_cstr(mrb, result, buffer);
return result;
return mrb_obj_freeze(mrb, result);
}
mrb_value rb_KernAux_utoa10(mrb_state *mrb, mrb_value self)
@ -95,7 +95,7 @@ mrb_value rb_KernAux_utoa10(mrb_state *mrb, mrb_value self)
mrb_value result = mrb_str_new_lit(mrb, "");
result = mrb_str_cat_cstr(mrb, result, buffer);
return result;
return mrb_obj_freeze(mrb, result);
}
mrb_value rb_KernAux_itoa10(mrb_state *mrb, mrb_value self)
@ -110,7 +110,7 @@ mrb_value rb_KernAux_itoa10(mrb_state *mrb, mrb_value self)
mrb_value result = mrb_str_new_lit(mrb, "");
result = mrb_str_cat_cstr(mrb, result, buffer);
return result;
return mrb_obj_freeze(mrb, result);
}
mrb_value rb_KernAux_utoa16(mrb_state *mrb, mrb_value self)
@ -130,7 +130,7 @@ mrb_value rb_KernAux_utoa16(mrb_state *mrb, mrb_value self)
mrb_value result = mrb_str_new_lit(mrb, "");
result = mrb_str_cat_cstr(mrb, result, buffer);
return result;
return mrb_obj_freeze(mrb, result);
}
mrb_value rb_KernAux_itoa16(mrb_state *mrb, mrb_value self)
@ -145,7 +145,7 @@ mrb_value rb_KernAux_itoa16(mrb_state *mrb, mrb_value self)
mrb_value result = mrb_str_new_lit(mrb, "");
result = mrb_str_cat_cstr(mrb, result, buffer);
return result;
return mrb_obj_freeze(mrb, result);
}
int convert_base(mrb_state *mrb, mrb_value base_rb)

View file

@ -2,7 +2,7 @@ def test_utoa(number, base, expected)
result = KernAux.utoa(number, base)
assert_true result.instance_of? String
#assert_true result.frozen?
assert_true result.frozen?
assert_equal expected, result
end
@ -10,7 +10,7 @@ def test_itoa(number, base, expected)
result = KernAux.itoa(number, base)
assert_true result.instance_of? String
#assert_true result.frozen?
assert_true result.frozen?
assert_equal expected, result
end