Comments (6)
I recently noticed this too. Here's a patch with a single unit test added. (More
however would not be a bad idea.)
In addition to the above noted fix there are two other small changes.
Also "make test" in the source was not working because in this line
test: @echo
there should be a line break. And while I was in that section I added a "check"
target as sort of an alias for "test". (GNU automake uses "make check" instead
of
"make test".
Original comment by rocky.bernstein
on 27 Sep 2008 at 9:54
Attachments:
from shunit2.
Hi Rocky,
I'm not sure what I need to do with assert-output.diff
I tried:
patch shunit2 < assert-output.diff
but got:
Processing... I cannot find a patch in there anywhere.
Is there another patch-like utility I should be using? Do I need to split up
the file assert-output.diff and patch using just one part of it?
Regards, Mal.
Original comment by [email protected]
on 3 Oct 2008 at 4:34
from shunit2.
Works for me
$ cd ...shunit2/trunk/source/2.1
$ patch -p0 < ~/Desktop/assert-output.diff
patching file src/shell/shunit2.
...
$ patch --version
patch 2.5.9
Copyright (C) 1988 Larry Wall
Copyright (C) 2003 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
If this is not the version of that your are using get it from
ftp://ftp.gnu.org:/pub/gnu/patch/patch-2.5.4.tar.gz
If you can't do that, edit the file:
--- src/shell/shunit2 (revision 226)
+++ src/shell/shunit2 (working copy)
@@ -124,7 +124,7 @@
[ -z "${shunit_message_:-}" ] && shunit_message_=''
if [ $# -eq 3 ]; then
- shunit_message_="${shunit_message_}$1"
+ shunit_message_="$1"
shift
fi
shunit_expected_=$1
And look for a line like the one that has - in it and change it to a
line like the one that has + in it.
Good luck.
Original comment by rocky.bernstein
on 3 Oct 2008 at 7:15
from shunit2.
The provided patch is only a hack to fix a larger problem, one that stems from
the _SHUNIT_LINENO_ macro. I'm
looking into it.
Original comment by [email protected]
on 7 Oct 2008 at 10:25
- Changed state: Accepted
from shunit2.
Ah, actually it stems from the fact that when assertEquals fails, it calls
failNotEqual, which itself extends the
shunit_message_ variable yet again with the same information. Now, how to fix...
Original comment by [email protected]
on 7 Oct 2008 at 10:44
from shunit2.
Fixed in rev# 230.
Original comment by [email protected]
on 7 Oct 2008 at 11:16
- Changed state: Fixed
from shunit2.
Related Issues (20)
- "Ran X tests." message is not accurate if a test exits
- fail fails to fail the test immediately HOT 4
- shunit2 Debian/Ubuntu packages out of date HOT 20
- Use https://bpkg.sh/ as package manager
- Warning "can only `return' from a function or sourced script" when executing in standalone mode (in Bash shell) HOT 1
- Should there be a counter for skipped tests in addition to the number of skipped asserts? HOT 5
- "[[: not found" error when sourcing files
- Test with bash in posix mode
- Next release ? HOT 4
- Mock and expect HOT 3
- Update version distributed through apt HOT 3
- [BASH] _SHUNIT_LINENO_ error if IFS is redefined HOT 4
- How to only execute specified test cases instead of all ? HOT 1
- What scenarios and how to use Error handling?
- Cannot source unit tests from unit tests HOT 1
- 执行单个案例,是否可以打印他的执行过程
- assertNotNull not working with set -e HOT 2
- egrep: warning: egrep is obsolescent; using grep -E HOT 5
- Add snapshot testing support
- want new version HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shunit2.