[PATCH] test-bisect: test handling of invalid commands without relying on sh

Mads Kiilerich mads at kiilerich.com
Mon Dec 28 18:07:43 CST 2009


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1262044990 -3600
# Node ID d71e97a9a377956087b4131271022bca2630e3b8
# Parent  9c59cdafcc247f227bd5f82db231ff53db101987
test-bisect: test handling of invalid commands without relying on sh

diff --git a/tests/test-bisect b/tests/test-bisect
--- a/tests/test-bisect
+++ b/tests/test-bisect
@@ -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
diff --git a/tests/test-bisect.out b/tests/test-bisect.out
--- a/tests/test-bisect.out
+++ b/tests/test-bisect.out
@@ -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


More information about the Mercurial-devel mailing list