From 5e1c83f5b14524e56480bac28b51eda81d910a2b Mon Sep 17 00:00:00 2001 From: Jun Wu Date: Tue, 18 Oct 2016 22:28:50 +0100 Subject: [PATCH] test-check: backport test-check-shbang from core hg Summary: This is the last one of the test-check series. `test-check-py3-compat.t` was ignored intentionally as we do not care about Python 3 support right now. Test Plan: `arc unit` Reviewers: #sourcecontrol, stash Reviewed By: stash Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4039479 Signature: t1:4039479:1476876594:5b95aad9be245a86dc9327770502830896273131 --- tests/test-check-shbang-hg.t | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/test-check-shbang-hg.t diff --git a/tests/test-check-shbang-hg.t b/tests/test-check-shbang-hg.t new file mode 100644 index 0000000000..c21dacf134 --- /dev/null +++ b/tests/test-check-shbang-hg.t @@ -0,0 +1,16 @@ +#require test-repo + +This file is backported from mercurial/tests/test-check-shbang.t. + + $ . "$RUNTESTDIR/helpers-testrepo.sh" + $ cd "$TESTDIR"/.. + +look for python scripts that do not use /usr/bin/env + + $ 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"^#!.*/bi{1}n/sh") and not grep(r"^#!/bi{1}n/sh")' + [1]