[PATCH 1 of 6 v2] test-check-shbang: work around check-code not wanting hardcoded paths

Augie Fackler raf at durin42.com
Tue Jul 12 19:49:48 UTC 2016


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1468351944 14400
#      Tue Jul 12 15:32:24 2016 -0400
# Node ID 31f958c411e7040bb71fdd52682004f518badab3
# Parent  e5b4d79a9140c3d90e9b6aa22070351b73ef2d4c
test-check-shbang: work around check-code not wanting hardcoded paths

I'm about to fix a bug in check-code that a # anywhere on a line
treated the rest of the line as a comment, even if it was
meaningful. This test is the one place we explicitly *do* want
hardcoded paths referenced, but we can work around that by specifying
bin as a regular expression.

diff --git a/tests/test-check-shbang.t b/tests/test-check-shbang.t
--- a/tests/test-check-shbang.t
+++ b/tests/test-check-shbang.t
@@ -5,10 +5,10 @@
 
 look for python scripts that do not use /usr/bin/env
 
-  $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env python")'
+  $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bi{1}n/env python")'
   [1]
 
 look for shell scripts that do not use /bin/sh
 
-  $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")'
+  $ hg files 'set:grep(r"^#!.*/bi{1}n/sh") and not grep(r"^#!/bi{1}n/sh")'
   [1]


More information about the Mercurial-devel mailing list