You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using strutils.splitLines with the keepEol option I would expect that since the EOL is part of the string output, that we wouldn't have another empty line after the last EOL.
Example
test"keepEol splits too much":
let expected =
[
@[], # Fails, actual result @[""]@["Some"],
@["Some\n"], # Fails, actual result @["Some\n", ""]@["Some\n", "String"],
@["Some\n", "String\n"], # Fails, actual result @["Some\n", "String\n", ""]
]
let testStrings =
[
"",
"Some",
"Some\n",
"Some\nString",
"Some\nString\n",
]
for (e, ts) inzip(expected, testStrings):
check(e == strutils.splitLines(ts, keepEol=true))
Current Output
See above
Expected Output
See above
Reasoning:
Now the EOL is counted as a split and still in the string. So in a way it's counted twice.
When using strutils.splitLines with the keepEol option I would expect that since the EOL is part of the string output, that we wouldn't have another empty line after the last EOL.
Example
Current Output
See above
Expected Output
See above
Reasoning:
Possible Solution
Additional Information
nim -v
).1.0.0
Not sure
Didn't find one.
None available.
The text was updated successfully, but these errors were encountered: