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 "documentation" (i.e. shellspec -fd) output format in the console, The "expected:" / "got:" indentation makes it really hard to notice white-space issues when comparing multi-line strings.
Here is my example :
print_a_lot() {
echo -e ' one space'
echo -e ' two spaces'
echo -e ' "two spaces with double-quotes"'
echo -e '\tone tab'
echo -e '\t one tab one space'
echo -e ' \tone space one tab'
}
It 'dummy example'
When run print_a_lot
The stdout should equal ' one space
two spaces
"two spaces with double-quotes"
one tab'
End
And the associated shellspec output (which I find really hard to read):
When using JUnit XML output format, this makes whitespace easier to spot and I can parse the result inside a proper editor (vi, emacs, ...) or even display it using xunit-viewer.
However, the "expected:" / "got:" formatting with double-quotes still introduces double-quotes errors in the output (as shown in the following xunit-viewer output screenshot):
If anyone has an idea to or a better way to write tests with multiline comparisons, I'll be very thankful
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
When using "documentation" (i.e.
shellspec -fd) output format in the console, The "expected:" / "got:" indentation makes it really hard to notice white-space issues when comparing multi-line strings.Here is my example :
And the associated shellspec output (which I find really hard to read):

When using JUnit XML output format, this makes whitespace easier to spot and I can parse the result inside a proper editor (vi, emacs, ...) or even display it using xunit-viewer.
However, the "expected:" / "got:" formatting with double-quotes still introduces double-quotes errors in the output (as shown in the following xunit-viewer output screenshot):
If anyone has an idea to or a better way to write tests with multiline comparisons, I'll be very thankful
Cheers,
Aurel
Beta Was this translation helpful? Give feedback.
All reactions