1 |
# -*-perl-*- |
# -*-perl-*- |
2 |
$description = "Test the word, words, and wordlist functions.\n"; |
$description = "\ |
3 |
|
Test the word, words, wordlist, firstword, and lastword functions.\n"; |
4 |
|
|
5 |
$details = "\ |
$details = "\ |
6 |
Produce a variable with a large number of words in it, |
Produce a variable with a large number of words in it, |
88 |
$answer = "$makefile2:9: *** non-numeric second argument to `wordlist' function: ' 12a '. Stop.\n"; |
$answer = "$makefile2:9: *** non-numeric second argument to `wordlist' function: ' 12a '. Stop.\n"; |
89 |
&compare_output($answer, &get_logfile(1)); |
&compare_output($answer, &get_logfile(1)); |
90 |
|
|
91 |
|
|
92 |
|
# TEST #8 -- test $(firstword ) |
93 |
|
# |
94 |
|
run_make_test(' |
95 |
|
void := |
96 |
|
list := $(void) foo bar baz # |
97 |
|
|
98 |
|
a := $(word 1,$(list)) |
99 |
|
b := $(firstword $(list)) |
100 |
|
|
101 |
|
.PHONY: all |
102 |
|
|
103 |
|
all: |
104 |
|
@test "$a" = "$b" && echo $a |
105 |
|
', |
106 |
|
'', |
107 |
|
'foo'); |
108 |
|
|
109 |
|
|
110 |
|
# TEST #9 -- test $(lastword ) |
111 |
|
# |
112 |
|
run_make_test(' |
113 |
|
void := |
114 |
|
list := $(void) foo bar baz # |
115 |
|
|
116 |
|
a := $(word $(words $(list)),$(list)) |
117 |
|
b := $(lastword $(list)) |
118 |
|
|
119 |
|
.PHONY: all |
120 |
|
|
121 |
|
all: |
122 |
|
@test "$a" = "$b" && echo $a |
123 |
|
', |
124 |
|
'', |
125 |
|
'baz'); |
126 |
|
|
127 |
# This tells the test driver that the perl test script executed properly. |
# This tells the test driver that the perl test script executed properly. |
128 |
1; |
1; |