pkgsrc-Changes archive

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

CVS commit: pkgsrc/regress/infra-unittests



Module Name:    pkgsrc
Committed By:   rillig
Date:           Mon May 11 19:17:22 UTC 2020

Modified Files:
        pkgsrc/regress/infra-unittests: subst.sh

Log Message:
regress/infra-unittests: add tests for identity substitutions


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 pkgsrc/regress/infra-unittests/subst.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/regress/infra-unittests/subst.sh
diff -u pkgsrc/regress/infra-unittests/subst.sh:1.34 pkgsrc/regress/infra-unittests/subst.sh:1.35
--- pkgsrc/regress/infra-unittests/subst.sh:1.34        Mon May 11 19:13:10 2020
+++ pkgsrc/regress/infra-unittests/subst.sh     Mon May 11 19:17:22 2020
@@ -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 @@ if test_case_begin "identity substitutio
        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