summaryrefslogtreecommitdiffstats
path: root/tests/018
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-14 06:51:02 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-14 06:51:02 -0700
commit86d04654a747f537c43e464adb227118d11bfd10 (patch)
treef9439d29eb7d53434974b8c4fc6548f99346f723 /tests/018
parentd64767f3dd63b6ae43d52f614efe53d2ddb47f2e (diff)
downloadtxr-86d04654a747f537c43e464adb227118d11bfd10.tar.gz
txr-86d04654a747f537c43e464adb227118d11bfd10.tar.bz2
txr-86d04654a747f537c43e464adb227118d11bfd10.zip
format: new precision - character for zero.
* stream.c (formatv): The - precision option character produces a "sign" that is a zero. If this is used with leading zeros, it will avoid generating a space. The requirements can use improvement here, but one step at a time. * tests/018/format.tl: Some tests. * txr.1: Documented.
Diffstat (limited to 'tests/018')
-rw-r--r--tests/018/format.tl5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/018/format.tl b/tests/018/format.tl
index b8cf7445..6c58d45b 100644
--- a/tests/018/format.tl
+++ b/tests/018/format.tl
@@ -24,6 +24,11 @@
(fmt "~4,03x" #xaf) " 0af"
(fmt "~-4,03X" #xaf) "0AF ")
+(mtest
+ (fmt "~8,02f" 12) " 0012.00"
+ (fmt "~8,+02f" 12) "+0012.00"
+ (fmt "~8,-02f" 12) "00012.00")
+
(test
(fmt "~x" (sha256 "abc"))
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad")