diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-12-20 16:54:34 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-12-20 16:54:34 +0200 |
commit | 664bc44f302ca9cbed02788fea4414b815b1ac65 (patch) | |
tree | 6b65d7c0d72c00de2447fc68656824b5fddcb81a /tests | |
parent | d50f649cf8a10c98085f10ef476d43e902458e3c (diff) | |
download | micropython-664bc44f302ca9cbed02788fea4414b815b1ac65.tar.gz micropython-664bc44f302ca9cbed02788fea4414b815b1ac65.zip |
tests: Add tests for %-formatting of bytes.
This requires CPython3.5, to not require switching to it, just use .exp
file.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/bytes_format_modulo.py | 7 | ||||
-rw-r--r-- | tests/basics/bytes_format_modulo.py.exp | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/basics/bytes_format_modulo.py b/tests/basics/bytes_format_modulo.py new file mode 100644 index 0000000000..70246e72dc --- /dev/null +++ b/tests/basics/bytes_format_modulo.py @@ -0,0 +1,7 @@ +# This test requires CPython3.5 +print(b"%%" % ()) +print(b"=%d=" % 1) +print(b"=%d=%d=" % (1, 2)) + +print(b"=%s=" % b"str") +print(b"=%r=" % b"str") diff --git a/tests/basics/bytes_format_modulo.py.exp b/tests/basics/bytes_format_modulo.py.exp new file mode 100644 index 0000000000..782b7f91fc --- /dev/null +++ b/tests/basics/bytes_format_modulo.py.exp @@ -0,0 +1,5 @@ +b'%' +b'=1=' +b'=1=2=' +b'=str=' +b"=b'str'=" |