summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/string-format-modulo.py
diff options
context:
space:
mode:
authorDave Hylands <dhylands@gmail.com>2014-04-02 11:42:39 -0700
committerDave Hylands <dhylands@gmail.com>2014-04-03 23:55:02 -0700
commit6756a37a77b64b804ee681a22935e0077226eb63 (patch)
treed2428d29b9ce1ccd1a1877c3663aded1e98bfce8 /tests/basics/string-format-modulo.py
parent5bf565e353b73bc87e0b918368dadac701644078 (diff)
downloadmicropython-6756a37a77b64b804ee681a22935e0077226eb63.tar.gz
micropython-6756a37a77b64b804ee681a22935e0077226eb63.zip
Implements most of str.modulo
The alternate form for floating point doesn't work yet. The %(name)s form doesn't work yet.
Diffstat (limited to 'tests/basics/string-format-modulo.py')
-rw-r--r--tests/basics/string-format-modulo.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/basics/string-format-modulo.py b/tests/basics/string-format-modulo.py
index 0b50c2674a..82cbdddc7e 100644
--- a/tests/basics/string-format-modulo.py
+++ b/tests/basics/string-format-modulo.py
@@ -20,3 +20,25 @@ try:
print("=%s=" % (1, 2))
except TypeError:
print("TypeError")
+
+print("%c" % 48)
+print("%c" % 'a')
+print("%10s" % 'abc')
+print("%-10s" % 'abc')
+print("%d" % 10)
+print("%+d" % 10)
+print("% d" % 10)
+print("%d" % -10)
+print("%x" % 18)
+print("%o" % 18)
+print("%X" % 18)
+print("%#x" % 18)
+print("%#X" % 18)
+print("%#6x" % 18)
+print("%#06x" % 18)
+print("%e" % 1.23456)
+print("%E" % 1.23456)
+print("%f" % 1.23456)
+print("%F" % 1.23456)
+print("%g" % 1.23456)
+print("%G" % 1.23456)