I'd like to make two suggestions:
1. Add -t|--trim to assert_line
The goal here would be to trim input before comparing it, so that all whitespaces before and after are removed. That's sometimes useful when you don't know how many spaces will be in the content, because it's sometimes based on terminal width. And in some cases, when lines are smaller, or empty, comparison checks can be done on just an empty string and it'll work.
2. Add -q|--quotes to assert_line
This would prevent things like that:
-- line differs --
index : 1
expected :
actual :
--
And allow displaying errors like that for instance:
-- line differs --
index : 1
expected : ""
actual : " "
--
Easier debugging for string that are not trimmed beforehand.
I'm not sure yet how to contribute this, but I can help :)
I'd like to make two suggestions:
1. Add
-t|--trimtoassert_lineThe goal here would be to trim input before comparing it, so that all whitespaces before and after are removed. That's sometimes useful when you don't know how many spaces will be in the content, because it's sometimes based on terminal width. And in some cases, when lines are smaller, or empty, comparison checks can be done on just an empty string and it'll work.
2. Add
-q|--quotestoassert_lineThis would prevent things like that:
And allow displaying errors like that for instance:
Easier debugging for string that are not trimmed beforehand.
I'm not sure yet how to contribute this, but I can help :)