-
Notifications
You must be signed in to change notification settings - Fork 201
Improve output when string not equal for long strings #104
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -630,7 +630,12 @@ failNotEquals() { | |
| shunit_actual_=$2 | ||
|
|
||
| shunit_message_=${shunit_message_%% } | ||
| _shunit_assertFail "${shunit_message_:+${shunit_message_} }expected:<${shunit_expected_}> but was:<${shunit_actual_}>" | ||
| if command [ $(echo "${shunit_expected_}" | wc -l) -gt 10 ] || command [ $(echo "${shunit_actual_}" | wc -l) -gt 10 ]; then | ||
|
daveshepherd marked this conversation as resolved.
Outdated
|
||
| diff_output_=$(diff <(echo "${shunit_expected_}") <(echo "${shunit_actual_}")) | ||
|
daveshepherd marked this conversation as resolved.
Outdated
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I recognize process substitution
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is process substitution, it provides a way of passing the output of a command to another command where pipe is not available. diff takes filenames, but the items that want to be diff'd are in variables. |
||
| _shunit_assertFail "${shunit_message_:+${shunit_message_} }diff:<${diff_output_}>" | ||
| else | ||
| _shunit_assertFail "${shunit_message_:+${shunit_message_} }expected:<${shunit_expected_}> but was:<${shunit_actual_}>" | ||
| fi | ||
|
|
||
| unset shunit_message_ shunit_expected_ shunit_actual_ | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add your new variable here. |
||
| return ${SHUNIT_FALSE} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.