summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2018-01-09 16:22:38 +0000
committerGitHub <noreply@github.com>2018-01-09 16:22:38 +0000
commite7e37713dda4017d2f8fb2f1c9481194314e9d60 (patch)
treea5d9a5d605bd18aea25bca57959e491e66b0db0b /tests
parentb6b99da08ff52095a6ab409aa2fa91d381179ab9 (diff)
parent624bd847fb2dfdeca00548947ba248a7b32d2e03 (diff)
downloadNim-e7e37713dda4017d2f8fb2f1c9481194314e9d60.tar.gz
Merge pull request #7045 from GULPF/fmt-str-fallback
Add additional $ fallback to fmt
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tstrformat.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/stdlib/tstrformat.nim b/tests/stdlib/tstrformat.nim
new file mode 100644
index 000000000..4e5c614a7
--- /dev/null
+++ b/tests/stdlib/tstrformat.nim
@@ -0,0 +1,13 @@
+discard """
+    action: "run"
+"""
+
+import strformat
+
+type Obj = object
+
+proc `$`(o: Obj): string = "foobar"
+
+var o: Obj
+doAssert fmt"{o}" == "foobar"
+doAssert fmt"{o:10}" == "foobar    "
\ No newline at end of file