BUG: asserEquals failes in bash when "nullglob" is set

53 views
Skip to first unread message

nomike

unread,
Mar 22, 2012, 3:48:38 PM3/22/12
to shunit2-users
Hi!

I found a bug in shunit2.

If you enable nullglob („shopt –s nullglob“) assertEquals crashes.

Example code:
----SNIP----
#!/bin/bash

test_1() {
assertEquals "This test works" "0" "0"
}

test_2() {
shopt -s nullglob
assertEquals "This test crashes" "0" "0"
}

. /projekte/install/lib/src/shunit2
----SNAP----

Output:
----SNIP----
test_1
test_2
/projekte/install/lib/src/shunit2: eval: line 105: unexpected EOF
while looking for matching `"'
/projekte/install/lib/src/shunit2: eval: line 106: syntax error:
unexpected end of file

Ran 2 tests.

OK
----SNAP----

cheers
nomike
Reply all
Reply to author
Forward
0 new messages