micropython/tests/unix
Joris Peeraer 5020b14d54 py/mpprint: Fix length calculation for strings with precision-modifier.
Two issues are tackled:

1. The calculation of the correct length to print is fixed to treat the
   precision as a maximum length instead as the exact length.
   This is done for both qstr (%q) and for regular str (%s).

2. Fix the incorrect use of mp_printf("%.*s") to mp_print_strn().

   Because of the fix of above issue, some testcases that would print
   an embedded null-byte (^@ in test-output) would now fail.
   The bug here is that "%s" was used to print null-bytes. Instead,
   mp_print_strn is used to make sure all bytes are outputted and the
   exact length is respected.

Test-cases are added for both %s and %q with a combination of precision
and padding specifiers.
2020-12-07 23:32:06 +11:00
..
extra_coverage.py examples: Add example code for user C modules, both C and C++. 2020-10-29 15:30:42 +11:00
extra_coverage.py.exp py/mpprint: Fix length calculation for strings with precision-modifier. 2020-12-07 23:32:06 +11:00
ffi_callback.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
ffi_callback.py.exp tests: Add testcase for ffi callbacks. 2014-12-15 02:18:54 +02:00
ffi_float.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
ffi_float.py.exp tests/ffi_float: Split tgammaf() testcase to a separate test. 2015-08-29 17:24:29 +03:00
ffi_float2.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
ffi_float2.py.exp tests/ffi_float: Split tgammaf() testcase to a separate test. 2015-08-29 17:24:29 +03:00
time.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00