[PATCH] test-help: improve test coverage

Henri Wiechers hwiechers at gmail.com
Mon Dec 21 04:20:47 CST 2009


# HG changeset patch
# User Henri Wiechers <hwiechers at gmail.com>
# Date 1261390723 -7200
# Node ID cd5706c8a32ac9be81851e837d8aa65e518a16e8
# Parent  1720d70cd6d4cbfdf6ed85833c4b0c1d17fec5f7
test-help: improve test coverage

Adds a test for displaying the short list of commands with
the verbose option i.e. 'hg -v help shortlist'.

Extends test coverage of commands.help_ by 2 lines.

diff -r 1720d70cd6d4 -r cd5706c8a32a tests/test-help
--- a/tests/test-help	Sun Dec 20 17:18:04 2009 +0100
+++ b/tests/test-help	Mon Dec 21 12:18:43 2009 +0200
@@ -4,6 +4,10 @@
 hg -q
 hg help
 hg -q help
+
+echo %% test short command list with verbose option
+hg -v help shortlist | sed 's/[(]version [^)]*[)]/(version xxx)/'
+
 hg add -h
 hg add --skjdfks
 hg help diff
diff -r 1720d70cd6d4 -r cd5706c8a32a tests/test-help.out
--- a/tests/test-help.out	Sun Dec 20 17:18:04 2009 +0100
+++ b/tests/test-help.out	Mon Dec 21 12:18:43 2009 +0200
@@ -170,6 +170,68 @@
  templating   Template Usage
  urls         URL Paths
  extensions   Using additional features
+%% test short command list with verbose option
+Mercurial Distributed SCM (version xxx)
+
+Copyright (C) 2005-2009 Matt Mackall <mpm at selenic.com> and others
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+basic commands:
+
+ add:
+      add the specified files on the next commit
+ annotate, blame:
+      show changeset information by line for each file
+ clone:
+      make a copy of an existing repository
+ commit, ci:
+      commit the specified files or all outstanding changes
+ diff:
+      diff repository (or selected files)
+ export:
+      dump the header and diffs for one or more changesets
+ forget:
+      forget the specified files on the next commit
+ init:
+      create a new repository in the given directory
+ log, history:
+      show revision history of entire repository or files
+ merge:
+      merge working directory with another revision
+ pull:
+      pull changes from the specified source
+ push:
+      push changes to the specified destination
+ remove, rm:
+      remove the specified files on the next commit
+ serve:
+      export the repository via HTTP
+ status, st:
+      show changed files in the working directory
+ summary, sum:
+      summarize working directory state
+ update, up, checkout, co:
+      update working directory
+
+global options:
+ -R --repository      repository root directory or name of overlay bundle file
+    --cwd             change working directory
+ -y --noninteractive  do not prompt, assume 'yes' for any required answers
+ -q --quiet           suppress output
+ -v --verbose         enable additional output
+    --config          set/override config option
+    --debug           enable debugging output
+    --debugger        start debugger
+    --encoding        set the charset encoding (default: ascii)
+    --encodingmode    set the charset encoding mode (default: strict)
+    --traceback       always print a traceback on exception
+    --time            time how long the command takes
+    --profile         print command execution profile
+    --version         output version information and exit
+ -h --help            display help and exit
+
+use "hg help" for the full list of commands
 hg add [OPTION]... [FILE]...
 
 add the specified files on the next commit


More information about the Mercurial-devel mailing list