diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-07 21:50:22 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-07 21:50:22 +0100 |
commit | 97543c5285b47c765e19d6ab7c08b36630e23c6a (patch) | |
tree | fd55f309f8eaa4059dd7e4160250c22f115d2b59 /tests | |
parent | 98dd6d7712acdefb9179743564ee546339da9519 (diff) | |
parent | 23dc6d0aceba51756f01e96c099678c38b4a88f9 (diff) | |
download | micropython-97543c5285b47c765e19d6ab7c08b36630e23c6a.tar.gz micropython-97543c5285b47c765e19d6ab7c08b36630e23c6a.zip |
Merge pull request #447 from dhylands/str-format-mpz
Add string formatting support for longlong and mpz.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/string-format-modulo.py | 1 | ||||
-rw-r--r-- | tests/basics/string-format.py | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/basics/string-format-modulo.py b/tests/basics/string-format-modulo.py index b736e2a73f..8e58be18c8 100644 --- a/tests/basics/string-format-modulo.py +++ b/tests/basics/string-format-modulo.py @@ -53,6 +53,7 @@ print("%X" % 18) print("%X" % 18.0) print("%#x" % 18) print("%#X" % 18) +print("%#6o" % 18) print("%#6x" % 18) print("%#06x" % 18) print("%e" % 1.23456) diff --git a/tests/basics/string-format.py b/tests/basics/string-format.py index 8049c6f73b..2d6d0cc721 100644 --- a/tests/basics/string-format.py +++ b/tests/basics/string-format.py @@ -24,11 +24,19 @@ test("{:4o}", 123) test("{:4x}", 123) test("{:4X}", 123) +test("{:4,d}", 12345678) + test("{:#4b}", 10) test("{:#4o}", 123) test("{:#4x}", 123) test("{:#4X}", 123) +test("{:#4d}", 0) +test("{:#4b}", 0) +test("{:#4o}", 0) +test("{:#4x}", 0) +test("{:#4X}", 0) + test("{:<6s}", "ab") test("{:>6s}", "ab") test("{:^6s}", "ab") |