diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2018-01-09 16:22:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-09 16:22:38 +0000 |
commit | e7e37713dda4017d2f8fb2f1c9481194314e9d60 (patch) | |
tree | a5d9a5d605bd18aea25bca57959e491e66b0db0b /tests | |
parent | b6b99da08ff52095a6ab409aa2fa91d381179ab9 (diff) | |
parent | 624bd847fb2dfdeca00548947ba248a7b32d2e03 (diff) | |
download | Nim-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.nim | 13 |
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 |