test-hgignore.t: add tests for comments
authorBryan O'Sullivan <bos@serpentine.com>
Thu, 10 Dec 2015 21:32:19 -0800
changeset 27326 ee2d7b5daa8a
parent 27325 eadbbd14bdc1
child 27327 d500341e4f55
test-hgignore.t: add tests for comments Although support for comments in hgignore files has existed for a while, it was previously untested.
tests/test-hgignore.t
--- a/tests/test-hgignore.t	Wed Dec 09 05:56:54 2015 +0000
+++ b/tests/test-hgignore.t	Thu Dec 10 21:32:19 2015 -0800
@@ -55,6 +55,23 @@
   ? a.c
   ? syntax
 
+Ensure that comments work:
+
+  $ touch 'foo#bar' 'quux#' 'baz\#wat'
+  $ cat <<'EOF' >> .hgignore
+  > # full-line comment
+  >   # whitespace-only comment line
+  > syntax# pattern, no whitespace, then comment
+  > a.c  # pattern, then whitespace, then comment
+  > baz\\# # escaped comment character
+  > foo\#b # escaped comment character
+  > quux\## escaped comment character at end of name
+  > EOF
+  $ hg status
+  A dir/b.o
+  ? .hgignore
+  $ rm 'foo#bar' 'quux#' 'baz\#wat'
+
 Check it does not ignore the current directory '.':
 
   $ echo "^\." > .hgignore