tests: Improve warning.c test coverage.
This commit is contained in:
parent
26f00ff154
commit
ec72db8a39
@ -38,6 +38,7 @@ ementation
|
|||||||
# runtime utils
|
# runtime utils
|
||||||
TypeError: can't convert str to int
|
TypeError: can't convert str to int
|
||||||
TypeError: unsupported types for : 'str', 'str'
|
TypeError: unsupported types for : 'str', 'str'
|
||||||
|
Warning: test
|
||||||
('0123456789', b'0123456789')
|
('0123456789', b'0123456789')
|
||||||
7300
|
7300
|
||||||
7300
|
7300
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "py/repl.h"
|
#include "py/repl.h"
|
||||||
#include "py/mpz.h"
|
#include "py/mpz.h"
|
||||||
#include "py/builtin.h"
|
#include "py/builtin.h"
|
||||||
|
#include "py/emit.h"
|
||||||
|
|
||||||
#if defined(MICROPY_UNIX_COVERAGE)
|
#if defined(MICROPY_UNIX_COVERAGE)
|
||||||
|
|
||||||
@ -130,6 +131,11 @@ STATIC mp_obj_t extra_coverage(void) {
|
|||||||
mp_call_function_2_protected(MP_OBJ_FROM_PTR(&mp_builtin_divmod_obj), mp_obj_new_str("abc", 3, false), mp_obj_new_str("abc", 3, false));
|
mp_call_function_2_protected(MP_OBJ_FROM_PTR(&mp_builtin_divmod_obj), mp_obj_new_str("abc", 3, false), mp_obj_new_str("abc", 3, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// warning
|
||||||
|
{
|
||||||
|
mp_emitter_warning(MP_PASS_CODE_SIZE, "test");
|
||||||
|
}
|
||||||
|
|
||||||
// return a tuple of data for testing on the Python side
|
// return a tuple of data for testing on the Python side
|
||||||
mp_obj_t items[] = {(mp_obj_t)&str_no_hash_obj, (mp_obj_t)&bytes_no_hash_obj};
|
mp_obj_t items[] = {(mp_obj_t)&str_no_hash_obj, (mp_obj_t)&bytes_no_hash_obj};
|
||||||
return mp_obj_new_tuple(MP_ARRAY_SIZE(items), items);
|
return mp_obj_new_tuple(MP_ARRAY_SIZE(items), items);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user