#6 non-integer value passed to shuAssert -> false positive

open
nobody
None
5
2012-12-11
2008-07-14
Jan Hutar
No

When I pass non-numeric argument to the shuAssert function, I get false positive.

E.g. test function like this:

---
function TestFoo() {
shuAssert "test true" 0
shuAssert "test false" 1
shuAssert "test false2" 139
shuAssert "test false3" 123456
shuAssert "test false4" -1
shuAssert "test false5"
shuAssert "test false6" "sdkfsddd"
---

Produces:

---
.EEEEEshUnit: line 143: [: sdkfsddd: integer expression expected
.
"test false" failed.
"test false2" failed.
"test false3" failed.
"test false4" failed.
"test false5" failed.

1 test run.
No tests succeeded.
1 test failed.
---

=> should list "test false6" as failed assert.

Versions:

ShUnit-1.4.gtar
bash-3.2-22.fc9.x86_64

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks