/[make]/make/tests/scripts/functions/word
ViewVC logotype

Diff of /make/tests/scripts/functions/word

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by psmith, Thu Jan 30 06:21:36 2003 UTC revision 1.4 by bosk, Thu Oct 21 17:42:25 2004 UTC
# Line 1  Line 1 
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,
# Line 87  $answer = "$makefile2:8: *** non-numeric Line 88  $answer = "$makefile2:8: *** non-numeric
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;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26