summary refs log tree commit diff stats
path: root/lib/pure/strformat.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-04-23 14:43:42 +0200
committerAraq <rumpf_a@web.de>2019-04-23 14:44:05 +0200
commit437f4648102d8bf5c59d9860a43766e5ae1994e1 (patch)
tree987787d219d1c79d93187eb98dd84cafb68a14d6 /lib/pure/strformat.nim
parent809a4a77a5a26b3dfc12ec64c587a1ec3a496b4c (diff)
downloadNim-437f4648102d8bf5c59d9860a43766e5ae1994e1.tar.gz
fixes #1192
Diffstat (limited to 'lib/pure/strformat.nim')
-rw-r--r--lib/pure/strformat.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/pure/strformat.nim b/lib/pure/strformat.nim
index 89273beb5..fdf1753a8 100644
--- a/lib/pure/strformat.nim
+++ b/lib/pure/strformat.nim
@@ -419,6 +419,9 @@ proc formatValue*(result: var string; value: SomeInteger; specifier: string) =
   ## Standard format implementation for ``SomeInteger``. It makes little
   ## sense to call this directly, but it is required to exist
   ## by the ``&`` macro.
+  if specifier.len == 0:
+    result.add $value
+    return
   let spec = parseStandardFormatSpecifier(specifier)
   var radix = 10
   case spec.typ
@@ -719,6 +722,10 @@ when isMainModule:
   let flfoo: float = 1.0
   check &"{flfoo}", "1.0"
 
+  # bug #11092
+  check &"{high(int64)}", "9223372036854775807"
+  check &"{low(int64)}", "-9223372036854775808"
+
   import json
 
   doAssert fmt"{'a'} {'b'}" == "a b"