diff options
Diffstat (limited to 'tests/stdlib/tstrformat.nim')
-rw-r--r-- | tests/stdlib/tstrformat.nim | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/stdlib/tstrformat.nim b/tests/stdlib/tstrformat.nim index 3c0d55c1d..ff406f898 100644 --- a/tests/stdlib/tstrformat.nim +++ b/tests/stdlib/tstrformat.nim @@ -562,7 +562,7 @@ proc main() = doAssert &"""{(if true: "'" & "'" & ')' else: "")}""" == "'')" doAssert &"{(if true: \"\'\" & \"'\" & ')' else: \"\")}" == "'')" doAssert fmt"""{(if true: "'" & ')' else: "")}""" == "')" - + block: # issue #20381 var ss: seq[string] template myTemplate(s: string) = @@ -573,5 +573,18 @@ proc main() = foo() doAssert ss == @["hello", "hello"] + block: + proc noraises() {.raises: [].} = + const + flt = 0.0 + str = "str" + + doAssert fmt"{flt} {str}" == "0.0 str" + + noraises() + + block: + doAssert not compiles(fmt"{formatting errors detected at compile time") + static: main() main() |