Skip to content
Snippets Groups Projects
Commit 923ebe76 authored by Damien George's avatar Damien George
Browse files

tests/unix: Add coverage test for calling mp_obj_new_bytearray.

parent 771dfb08
No related branches found
No related tags found
No related merge requests found
......@@ -231,6 +231,16 @@ STATIC mp_obj_t extra_coverage(void) {
mp_printf(&mp_plat_print, "%d\n", MP_OBJ_IS_QSTR(mp_obj_str_intern(mp_obj_new_str("intern me", 9))));
}
// bytearray
{
mp_printf(&mp_plat_print, "# bytearray\n");
// create a bytearray via mp_obj_new_bytearray
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(mp_obj_new_bytearray(4, "data"), &bufinfo, MP_BUFFER_RW);
mp_printf(&mp_plat_print, "%.*s\n", bufinfo.len, bufinfo.buf);
}
// mpz
{
mp_printf(&mp_plat_print, "# mpz\n");
......
......@@ -34,6 +34,8 @@ ementation
(start=1, stop=2, step=3)
# str
1
# bytearray
data
# mpz
1
12345678
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment