diff options
author | rillig <rillig@pkgsrc.org> | 2020-05-11 19:17:22 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2020-05-11 19:17:22 +0000 |
commit | 39abfafd824c2c48efb7cf955be472efa3332bd0 (patch) | |
tree | 825df68ce0b55833ee07ab1e1dbea04bf6008607 /regress/infra-unittests | |
parent | a880395fa2cd2ba5ddb93efa695963e868592f80 (diff) | |
download | pkgsrc-39abfafd824c2c48efb7cf955be472efa3332bd0.tar.gz |
regress/infra-unittests: add tests for identity substitutions
Diffstat (limited to 'regress/infra-unittests')
-rw-r--r-- | regress/infra-unittests/subst.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/regress/infra-unittests/subst.sh b/regress/infra-unittests/subst.sh index 1d2d24f3dad..9268740f466 100644 --- a/regress/infra-unittests/subst.sh +++ b/regress/infra-unittests/subst.sh @@ -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 substitution implementation"; then 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 |