[PATCH] test-help: improve test coverage

Henri Wiechers hwiechers at gmail.com
Mon Dec 21 21:08:23 CST 2009


# HG changeset patch
# User Henri Wiechers <hwiechers at gmail.com>
# Date 1261429306 -7200
# Node ID bdd913dd5d4d1d3b48f056532ce2c76d4d9280aa
# Parent  27457d31ae3f3b466edb784fe0ea0a14a917f812
test-help: improve test coverage

Adds a test for using the help option with the version option.

Extends test coverage of commands.help_ by another 2 lines.

diff -r 27457d31ae3f -r bdd913dd5d4d tests/test-help
--- a/tests/test-help	Mon Dec 14 00:32:29 2009 +0900
+++ b/tests/test-help	Mon Dec 21 23:01:46 2009 +0200
@@ -9,6 +9,10 @@
 hg -v help shortlist | sed 's/[(]version [^)]*[)]/(version xxx)/'
 
 hg add -h
+
+echo %% test help option with version option
+hg add -h --version | sed 's/[(]version [^)]*[)]/(version xxx)/'
+
 hg add --skjdfks
 hg help diff
 hg help status
diff -r 27457d31ae3f -r bdd913dd5d4d tests/test-help.out
--- a/tests/test-help.out	Mon Dec 14 00:32:29 2009 +0900
+++ b/tests/test-help.out	Mon Dec 21 23:01:46 2009 +0200
@@ -250,6 +250,31 @@
  -n --dry-run  do not perform actions, just print output
 
 use "hg -v help add" to show global options
+%% test help option with version 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.
+
+hg add [OPTION]... [FILE]...
+
+add the specified files on the next commit
+
+    Schedule files to be version controlled and added to the repository.
+
+    The files will be added to the repository at the next commit. To undo an
+    add before that, see hg forget.
+
+    If no names are given, add all files to the repository.
+
+options:
+
+ -I --include  include names matching the given patterns
+ -X --exclude  exclude names matching the given patterns
+ -n --dry-run  do not perform actions, just print output
+
+use "hg -v help add" to show global options
 hg add: option --skjdfks not recognized
 hg add [OPTION]... [FILE]...
 


More information about the Mercurial-devel mailing list