parent
4deda6b732
commit
7674df0dff
1 changed files with 6 additions and 1 deletions
|
|
@ -258,7 +258,9 @@ template callFormat(res, arg) {.dirty.} =
|
|||
# workaround in order to circumvent 'strutils.format' which matches
|
||||
# too but doesn't adhere to our protocol.
|
||||
res.add arg
|
||||
elif compiles(format(arg, res)):
|
||||
elif compiles(format(arg, res)) and
|
||||
# Check if format returns void
|
||||
not (compiles do: discard format(arg, res)):
|
||||
format(arg, res)
|
||||
elif compiles(format(arg)):
|
||||
res.add format(arg)
|
||||
|
|
@ -684,6 +686,9 @@ when isMainModule:
|
|||
var nullTime: DateTime
|
||||
check &"{nullTime:yyyy-mm-dd}", "0000-00-00"
|
||||
|
||||
var tm = fromUnix(0)
|
||||
discard &"{tm}"
|
||||
|
||||
# Unicode string tests
|
||||
check &"""{"αβγ"}""", "αβγ"
|
||||
check &"""{"αβγ":>5}""", " αβγ"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue