[PATCH] Fail if we can't create the input or expected output file.

Jim Meyering jim at meyering.net
Mon May 14 09:33:42 UTC 2007


Signed-off-by: Jim Meyering <jim at meyering.net>
---
 tests/t2000-mkfs.sh |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/t2000-mkfs.sh b/tests/t2000-mkfs.sh
index aa72de5..fb42f7a 100755
--- a/tests/t2000-mkfs.sh
+++ b/tests/t2000-mkfs.sh
@@ -64,11 +64,7 @@ mkfs
 No
 quit
 EOF
-
-# create output with expected prompt
-cat <<EOF > exp || fail=1
-Warning: The existing file system will be destroyed and all data on the partition will be lost. Do you want to continue?
-EOF
+test_expect_success 'create input file' 'test $fail = 0'
 
 test_expect_success \
     'create a partition and a filesystem in the same session' \
@@ -79,6 +75,9 @@ test_expect_success \
     'sed -n "s/.*\(Warning: The existing.*\)$/\1/p" out > out2'
 
 test_expect_success \
-    'check for expected prompt' '$compare out2 exp'
+    'check for expected prompt' \
+    'echo "Warning: The existing file system will be destroyed and all" \
+       "data on the partition will be lost. Do you want to continue?" > exp &&
+     $compare out2 exp'
 
 test_done
-- 
1.5.2.rc3.27.g43d151

For the record, here's a copy of the patch,
http://sysclose.org/parted/
----------------------------------


More information about the parted-devel mailing list