Patchwork [1,of,6] hgignore: update \-escape test to reflect actual behavior

login
register
mail settings
Submitter Yuya Nishihara
Date July 21, 2019, 6:56 a.m.
Message ID <3b489804371220799078.1563692170@mimosa>
Download mbox | patch
Permalink /patch/40986/
State Accepted
Headers show

Comments

Yuya Nishihara - July 21, 2019, 6:56 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1563683447 -32400
#      Sun Jul 21 13:30:47 2019 +0900
# Node ID 3b48980437122079907807800b5cdc5adfa8a6a6
# Parent  513a97303bbcea4ecc1628486f700d89e6714a48
hgignore: update \-escape test to reflect actual behavior

"\\<char>" is not an escape character but "\\" + <char>.

Patch

diff --git a/tests/test-hgignore.t b/tests/test-hgignore.t
--- a/tests/test-hgignore.t
+++ b/tests/test-hgignore.t
@@ -92,14 +92,14 @@  Ensure that comments work:
 
   $ touch 'foo#bar' 'quux#'
 #if no-windows
-  $ touch 'baz\#wat'
+  $ touch 'baz\wat'
 #endif
   $ 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
+  > baz\\# # (escaped) backslash, then comment
   > foo\#b # escaped comment character
   > quux\## escaped comment character at end of name
   > EOF
@@ -108,7 +108,7 @@  Ensure that comments work:
   ? .hgignore
   $ rm 'foo#bar' 'quux#'
 #if no-windows
-  $ rm 'baz\#wat'
+  $ rm 'baz\wat'
 #endif
 
 Check that '^\.' does not ignore the root directory: