stefan2904 / shunit2

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

mkdir_test.sh testExistingDirectoryCreationFails fails on assertNotNull #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. execute mkdir_test.sh

What is the expected output?
All tests pass

What do you see instead?
testMissingDirectoryCreation
testExistingDirectoryCreationFails
ASSERT:expected error message to stderr
testParentDirectoryCreation

Ran 3 tests.

What version of the product are you using? On what operating system?

shuint2-2.1.5

$ bash --version
GNU bash, version 3.00.15(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.

Please provide any additional information below.
Problem seems to be in the assertTrue, the else clase which evaulates the 
passed-in condition. Debugging output looks as follows:

testExistingDirectoryCreationFails
[ -d '/tmp/shunit.d19435/some_test_dir' ]
[ -z '' ]
++++ cat /tmp/shunit.d19435/output/stderr
+++ assertNotNull 'expected error message to stderr' 'mkdir: cannot create 
directory `/tmp/shunit.d19435/some_test_dir'\'': File exists'
+++ eval '__shunit_lineno="";' if '[' '"${1:-}"' = '"--lineno"' '];' 
then '[' -n '"$2"' ']' '&&' '__shunit_lineno="[$2]' '";' shift '2;' fi
++++ __shunit_lineno=
++++ '[' 'expected error message to stderr' = --lineno ']'
+++ '[' 2 -gt 2 ']'
+++ _shunit_shouldSkip
+++ '[' 1 -eq 1 ']'
+++ return 1
+++ shunit_message_=
+++ '[' 2 -eq 2 ']'
+++ shunit_message_='expected error message to stderr'
+++ shift
+++ assertTrue 'expected error message to stderr' '[ -n '\''mkdir: cannot 
create directory `/tmp/shunit.d19435/some_test_dir'\'': File exists'\'' ]'
+++ eval '__shunit_lineno="";' if '[' '"${1:-}"' = '"--lineno"' '];' 
then '[' -n '"$2"' ']' '&&' '__shunit_lineno="[$2]' '";' shift '2;' fi
++++ __shunit_lineno=
++++ '[' 'expected error message to stderr' = --lineno ']'
+++ '[' 2 -gt 2 ']'
+++ _shunit_shouldSkip
+++ '[' 1 -eq 1 ']'
+++ return 1
+++ shunit_message_=
+++ '[' 2 -eq 2 ']'
+++ shunit_message_='expected error message to stderr'
+++ shift
+++ shunit_condition_='[ -n '\''mkdir: cannot create directory 
`/tmp/shunit.d19435/some_test_dir'\'': File exists'\'' ]'
++++ expr '[ -n '\''mkdir: cannot create directory 
`/tmp/shunit.d19435/some_test_dir'\'': File exists'\'' ]' : '\([0-9]*\)'
+++ shunit_match_=
+++ shunit_return=0
+++ '[' -z '[ -n '\''mkdir: cannot create directory 
`/tmp/shunit.d19435/some_test_dir'\'': File exists'\'' ]' ']'
+++ '[' '[ -n '\''mkdir: cannot create directory 
`/tmp/shunit.d19435/some_test_dir'\'': File exists'\'' ]' = '' ']'
+++ echo '[' -n ''\''mkdir:' cannot create 
directory '`/tmp/shunit.d19435/some_test_dir'\'':' File 'exists'\''' ']'
[ -n 'mkdir: cannot create directory `/tmp/shunit.d19435/some_test_dir': 
File exists' ]
+++ '[' 1 -ne 0 ']'
+++ shunit_return=1
+++ '[' 1 -eq 0 ']'
+++ _shunit_assertFail 'expected error message to stderr'
+++ _shunit_msg_='expected error message to stderr'
+++ __shunit_testSuccess=1
++++ expr 0 + 1
+++ __shunit_assertsFailed=1
++++ expr 7 + 1
+++ __shunit_assertsTotal=8
+++ echo 'ASSERT:expected error message to stderr'
ASSERT:expected error message to stderr
+++ unset _shunit_msg_
+++ unset shunit_message_ shunit_condition_ shunit_match_
+++ return 1
+++ shunit_return=1
+++ unset shunit_message_
+++ return 1
+++ set +x

Original issue reported on code.google.com by jimmy...@gmail.com on 17 Aug 2009 at 8:40

GoogleCodeExporter commented 9 years ago
This seems to be a duplicate of Issue 14 - apologies for not reading the other 
issues before submitting. I don't see how I can delete or mark as a duplicate.

Original comment by jimmy...@gmail.com on 17 Aug 2009 at 8:42

GoogleCodeExporter commented 9 years ago
At a minimum, none of the example scripts were working as I did some directory 
shuffling some time back, so I fixed that in CL# 321.

As this issue is so old, I'm simply going to mark fixed.

Original comment by kate.war...@gtempaccount.com on 16 Mar 2011 at 9:13