stefan2904 / shunit2

Automatically exported from code.google.com/p/shunit2
0 stars 0 forks source link

asserEquals failes in bash when "nullglob" is set #32

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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----

shunit2 version: 2.1.6

os: IBM AIX 6.1
shell: /bin/bash version: 4.1.7(1)-release
shell: /bin/dash version: not installed
shell: /bin/ksh version: --version: 0403-010 A specified flag is not valid for 
this command.
shell: /bin/pdksh version: not installed
shell: /bin/sh version: unknown
shell: /bin/zsh version: not installed

Original issue reported on code.google.com by michael....@s-itsolutions.at on 23 Mar 2012 at 8:53

GoogleCodeExporter commented 9 years ago
Additionally this could not be tested using the provided unittests as the 
spawned shell always has nulllglob unset.

Original comment by michael....@s-itsolutions.at on 23 Mar 2012 at 9:36