summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-06-21 13:29:43 -0400
committerOri Bernstein <ori@eigenstate.org>2014-06-21 13:29:43 -0400
commit13c80d5f597c5c69ed312bb881826e819bf84d30 (patch)
tree1f52aa3985f53a49ba7a224cbc0d1a4984ea2cf8
parentf19346b49ebab6e9b8838f83f2aa51a98bd082ae (diff)
downloadmc-13c80d5f597c5c69ed312bb881826e819bf84d30.tar.gz
Add tests for padded format strings.
-rw-r--r--test/data/stdfmtpad-expected3
-rw-r--r--test/stdfmtpad.myr3
2 files changed, 6 insertions, 0 deletions
diff --git a/test/data/stdfmtpad-expected b/test/data/stdfmtpad-expected
index e17c712..4a8d113 100644
--- a/test/data/stdfmtpad-expected
+++ b/test/data/stdfmtpad-expected
@@ -1,4 +1,7 @@
abcd
00000bdcae
+abcdefghijkl
+a
10
0000000010
+100000
diff --git a/test/stdfmtpad.myr b/test/stdfmtpad.myr
index 33ea8bc..b566017 100644
--- a/test/stdfmtpad.myr
+++ b/test/stdfmtpad.myr
@@ -3,6 +3,9 @@ use std
const main = {
std.put("%10s\n", "abcd")
std.put("%010s\n", "bdcae")
+ std.put("%010s\n", "abcdefghijkl")
+ std.put("%01s\n", "a")
std.put("%10i\n", 10)
std.put("%010i\n", 10)
+ std.put("%3i\n", 100000)
}