Add unit test for ternary modifier
This commit is contained in:
parent
0d6723b09f
commit
71746b839b
|
@ -1,4 +1,4 @@
|
|||
# $Id: Makefile,v 1.8 2003/09/27 21:29:37 sjg Exp $
|
||||
# $Id: Makefile,v 1.9 2004/01/09 00:56:44 sjg Exp $
|
||||
#
|
||||
# Unit tests for make(1)
|
||||
# The main targets are:
|
||||
|
@ -16,7 +16,7 @@
|
|||
|
||||
UNIT_TESTS:= ${.PARSEDIR}
|
||||
|
||||
all: mod-ts varcmd modword
|
||||
all: mod-ts varcmd modword ternary
|
||||
|
||||
LIST= one two three
|
||||
LIST+= four five six
|
||||
|
@ -53,6 +53,11 @@ mod-ts:
|
|||
varcmd modword:
|
||||
@${.MAKE} -k -f ${UNIT_TESTS}/$@
|
||||
|
||||
ternary:
|
||||
@${.MAKE} -k -f ${UNIT_TESTS}/$@
|
||||
@${.MAKE} -k -f ${UNIT_TESTS}/$@ A=
|
||||
@${.MAKE} -k -f ${UNIT_TESTS}/$@ A=42
|
||||
|
||||
clean:
|
||||
rm -f *.out *.fail *.core
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
all:
|
||||
@echo "The answer is ${A:?known:unknown}"
|
||||
@echo "The answer is ${A:?$A:unknown}"
|
||||
@echo "The answer is ${empty(A):?empty:$A}"
|
|
@ -156,3 +156,12 @@ LIST:tw:C/ /,/g="one two three four five six"
|
|||
LIST:tw:C/ /,/1g="one two three four five six"
|
||||
LIST:tw:tW:C/ /,/="one,two three four five six"
|
||||
LIST:tW:tw:C/ /,/="one two three four five six"
|
||||
The answer is unknown
|
||||
The answer is unknown
|
||||
The answer is empty
|
||||
The answer is known
|
||||
The answer is
|
||||
The answer is empty
|
||||
The answer is known
|
||||
The answer is 42
|
||||
The answer is 42
|
||||
|
|
Loading…
Reference in New Issue