mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
rename strformat.fmt to % as it works better with backslash escape sequences; refs #6958
This commit is contained in:
@@ -22,7 +22,7 @@ proc frexp_test(lo, hi, step: float64) =
|
||||
doAssert(abs(rslt - x) < eps)
|
||||
|
||||
when manualTest:
|
||||
echo fmt("x: {x:10.3f} exp: {exp:4d} frac: {frac:24.20f} check: {$(abs(rslt - x) < eps):-5s} {rslt: 9.3f}")
|
||||
echo %("x: {x:10.3f} exp: {exp:4d} frac: {frac:24.20f} check: {$(abs(rslt - x) < eps):-5s} {rslt: 9.3f}")
|
||||
x += step
|
||||
|
||||
when manualTest:
|
||||
|
||||
@@ -9,5 +9,5 @@ type Obj = object
|
||||
proc `$`(o: Obj): string = "foobar"
|
||||
|
||||
var o: Obj
|
||||
doAssert fmt"{o}" == "foobar"
|
||||
doAssert fmt"{o:10}" == "foobar "
|
||||
doAssert %"{o}" == "foobar"
|
||||
doAssert %"{o:10}" == "foobar "
|
||||
Reference in New Issue
Block a user