Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --lean compiler flag; improve error message when strutils.% or addf throws by showing all useful context #14282

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
fixup
  • Loading branch information
timotheecour committed Jul 7, 2021
commit 7d453f0ba034c76fd235a0194fc6058e8c0ba059
7 changes: 6 additions & 1 deletion tests/stdlib/tstrutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ bar
when not defined(js):
doAssert formatFloat(123.456, ffScientific, precision = -1) == "1.234560e+02"

block: # `addf`, `%`
block: # `%`
doAssert "$# $3 $# $#" % ["a", "b", "c"] == "a c b c"
doAssert "${1}12 ${-1}$2" % ["a", "b"] == "a12 bb"
doAssert "$animal eats $food." % ["animal", "The cat", "food", "fish"] ==
Expand All @@ -703,6 +703,11 @@ bar
doAssert e.msg == "invalid char '$' at index: '2' for input: 'a $key2 b'", e.msg
ok = true
doAssert ok

block: # addf
var a = "foo:"
a.addf("$# $3 $# $#", "a", "b", "c")
doAssert a == "foo:a c b c"

block: # formatSize
disableVm:
Expand Down