Patchwork [1,of,2] tests: add tests for typoed commands

login
register
mail settings
Submitter via Mercurial-devel
Date July 7, 2017, 7:26 a.m.
Message ID <46c6014cd9765a04b61f.1499412375@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/22087/
State Accepted
Headers show

Comments

via Mercurial-devel - July 7, 2017, 7:26 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1499411564 25200
#      Fri Jul 07 00:12:44 2017 -0700
# Node ID 46c6014cd9765a04b61fe03b907f9eceaabba0dd
# Parent  38df146d06979ae7f5f334b5a55fdaf779b3f19a
tests: add tests for typoed commands

This includes one test showing how disabling a command with e.g.
"extensions.rebase=!" results in the command not being
suggested. We'll fix that next.

Patch

diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -660,6 +660,28 @@ 
   (use 'hg help' for the full list of commands or 'hg -v' for details)
   [255]
 
+Typoed command gives suggestion
+  $ hg puls
+  hg: unknown command 'puls'
+  (did you mean one of pull, push?)
+  [255]
+
+Not enabled extension gets suggested
+
+  $ hg rebase
+  hg: unknown command 'rebase'
+  'rebase' is provided by the following extension:
+  
+      rebase        command to move sets of revisions to a different ancestor
+  
+  (use 'hg help extensions' for information on enabling extensions)
+  [255]
+
+Disabled extension gets suggested
+  $ hg --config extensions.rebase=! rebase
+  hg: unknown command 'rebase'
+  (did you mean one of rename, resolve?)
+  [255]
 
 Make sure that we don't run afoul of the help system thinking that
 this is a section and erroring out weirdly.