string is missing formatting when calling fmt (#19780)
it appears the documentation intends to compare & with .fmt but there is no formatting in the string. even though the assert is true it doesn't quite prove that .fmt is an equivalent formatter.
This commit is contained in:
parent
85bc8326ac
commit
b9f243eb2a
1 changed files with 2 additions and 2 deletions
|
|
@ -705,6 +705,6 @@ macro `&`*(pattern: string{lit}): string =
|
|||
runnableExamples:
|
||||
let x = 7
|
||||
assert &"{x}\n" == "7\n" # regular string literal
|
||||
assert &"{x}\n" == "7\n".fmt # `fmt` can be used instead
|
||||
assert &"{x}\n" != fmt"7\n" # see `fmt` docs, this would use a raw string literal
|
||||
assert &"{x}\n" == "{x}\n".fmt # `fmt` can be used instead
|
||||
assert &"{x}\n" != fmt"{x}\n" # see `fmt` docs, this would use a raw string literal
|
||||
strformatImpl(pattern.strVal, '{', '}')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue