test-bisect: test handling of invalid commands without relying on sh stable
authorMads Kiilerich <mads@kiilerich.com>
Tue, 29 Dec 2009 01:03:10 +0100
branchstable
changeset 10147 27838bd9acf5
parent 10137 daec0f64656e
child 10148 fdeffbc9a6cc
child 10154 d4a62b6d4a58
test-bisect: test handling of invalid commands without relying on sh
tests/test-bisect
tests/test-bisect.out
--- a/tests/test-bisect	Thu Dec 24 11:40:39 2009 +0100
+++ b/tests/test-bisect	Tue Dec 29 01:03:10 2009 +0100
@@ -86,8 +86,9 @@
 set +e
 
 echo % test invalid command
+# assuming that the shell returns 127 if command not found ...
 hg bisect -r
-hg bisect --command './foobar' 2>&1 | sed 's|\(/bin/sh: \./foobar:\).*|\1 not found|'
+hg bisect --command 'exit 127'
 
 echo % test bisecting command
 cat > script.py <<EOF
--- a/tests/test-bisect.out	Thu Dec 24 11:40:39 2009 +0100
+++ b/tests/test-bisect.out	Tue Dec 29 01:03:10 2009 +0100
@@ -304,8 +304,7 @@
 summary:     msg 6
 
 % test invalid command
-/bin/sh: ./foobar: not found
-abort: failed to execute ./foobar
+abort: failed to execute exit 127
 % test bisecting command
 Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved