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