[PATCH 3 of 6] test-help: improve test coverage

Henri Wiechers hwiechers at gmail.com
Thu Dec 24 10:57:06 CST 2009


# HG changeset patch
# User Henri Wiechers <hwiechers at gmail.com>
# Date 1261673615 -7200
test-help: improve test coverage

Adds a test for commands without help text.

Extends test coverage of commands.help_ by 1 line.

diff -r b82bfb9fcbd6 -r 44f2ac3fd0d2 tests/test-help
--- a/tests/test-help
+++ b/tests/test-help
@@ -27,4 +27,25 @@
 hg help foo
 hg skjdfks
 
+cat > helpext.py <<EOF
+import os
+from mercurial import commands
+
+def nohelp(ui, *args, **kwargs):
+    pass
+
+cmdtable = {
+    "nohelp": (nohelp, [], "hg nohelp"),
+}
+
+commands.norepo += ' nohelp'
+EOF
+abspath=`pwd`/helpext.py
+
+echo '[extensions]' >> $HGRCPATH
+echo "helpext = $abspath" >> $HGRCPATH
+
+echo %% test command with no help text
+hg help nohelp
+
 exit 0
diff -r b82bfb9fcbd6 -r 44f2ac3fd0d2 tests/test-help.out
--- a/tests/test-help.out
+++ b/tests/test-help.out
@@ -462,3 +462,9 @@
  update     update working directory
 
 use "hg help" for the full list of commands or "hg -v" for details
+%% test command with no help text
+hg nohelp
+
+(no help text available)
+
+use "hg -v help nohelp" to show global options


More information about the Mercurial-devel mailing list