summaryrefslogtreecommitdiff
path: root/lib/std/test/fmt.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-10-10 11:24:21 -0700
committerOri Bernstein <ori@eigenstate.org>2016-10-10 11:24:21 -0700
commit20cea781b95e1a6c1fa2f6cd2bb6c05ec9a4480d (patch)
tree9eebc7c15901f65410cb2ccee4c0af3fb4229d7e /lib/std/test/fmt.myr
parent5d433bdf4af606e395b54aace8c0a27f745ae9ce (diff)
downloadmc-20cea781b95e1a6c1fa2f6cd2bb6c05ec9a4480d.tar.gz
Add slice format join option.
You can remove the end delimiters and join the values in a slice when printing using the 'j=' specifier: std.fmt("{j= }\n", [1,2,3][:]) will output: 1 2 3 instead of: [1, 2, 3]
Diffstat (limited to 'lib/std/test/fmt.myr')
-rw-r--r--lib/std/test/fmt.myr2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/std/test/fmt.myr b/lib/std/test/fmt.myr
index 4d7f30e..95d8f72 100644
--- a/lib/std/test/fmt.myr
+++ b/lib/std/test/fmt.myr
@@ -88,6 +88,8 @@ const builtins = {
check("[1, 2, 3] true", "{} {}", [1,2,3], true)
check("[1, 2, 3] true", "{} {}", [1,2,3][:], true)
+ check("1:2:3 true", "{j=:} {}", [1,2,3][:], true)
+ check("1... 2... 3 true", "{j=... } {}", [1,2,3][:], true)
}
const installed = {