Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/regress/infra-unittests regress/infra-unittests: add t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f7529abe36e9
branches:  trunk
changeset: 431303:f7529abe36e9
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon May 11 19:17:22 2020 +0000

description:
regress/infra-unittests: add tests for identity substitutions

diffstat:

 regress/infra-unittests/subst.sh |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r 2ada057b23a9 -r f7529abe36e9 regress/infra-unittests/subst.sh
--- a/regress/infra-unittests/subst.sh  Mon May 11 19:13:10 2020 +0000
+++ b/regress/infra-unittests/subst.sh  Mon May 11 19:17:22 2020 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: subst.sh,v 1.34 2020/05/11 19:13:10 rillig Exp $
+# $NetBSD: subst.sh,v 1.35 2020/05/11 19:17:22 rillig Exp $
 #
 # Tests for mk/subst.mk.
 #
@@ -1215,6 +1215,14 @@
        assert_identity 'no'    -e 's,[&],&,'
        assert_identity 'no'    -e 's,&,\&,' # this would be an identity
 
+       # References to Makefile variables can be identical too.
+       # See converters/help2man for an example.
+       assert_identity 'yes'   -e 's,\$(var),$(var),'
+
+       # An unescaped dollar means end-of-line and cannot be part of an
+       # identity substitution.  This may happen, but is clearly a typo.
+       assert_identity 'no'    -e 's,$(var),$(var),'
+
        test_case_end
 fi
 



Home | Main Index | Thread Index | Old Index