xref: /freebsd/contrib/bmake/unit-tests/varmod-exclam-shell.mk (revision 2c3632d14fe37fa35c262ee9fb66835be0a52621)
1# $NetBSD: varmod-exclam-shell.mk,v 1.2 2020/08/16 12:48:55 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