xref: /freebsd/contrib/bmake/unit-tests/varmod-exclam-shell.mk (revision 956e45f6fb3e18b8e89b1341708db60c30bb9f27)
1# $NetBSD: varmod-exclam-shell.mk,v 1.3 2020/10/24 08:46:08 rillig Exp $
2#
3# Tests for the :!cmd! variable modifier.
4
5.if ${:!echo hello | tr 'l' 'l'!} != "hello"
6.  warning unexpected
7.endif
8
9# The output is truncated at the first null byte.
10# Cmd_Exec returns only a string pointer without length information.
11.if ${:!echo hello | tr 'l' '\0'!} != "he"
12.  warning unexpected
13.endif
14
15.if ${:!echo!} != ""
16.  warning A newline at the end of the output must be stripped.
17.endif
18
19.if ${:!echo;echo!} != " "
20.  warning Only a single newline at the end of the output is stripped.
21.endif
22
23.if ${:!echo;echo;echo;echo!} != "   "
24.  warning Other newlines in the output are converted to spaces.
25.endif
26
27all:
28	@:;
29