Imported Upstream version 1.4.17
[platform/upstream/m4.git] / checks / 075.shift
1 dnl @ ../doc/m4.texi:3062: Origin of test
2 dnl @ expected status: 0
3 dnl @ extra options: 
4 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
5 dnl @ Foundation, Inc.
6 dnl @ This file is free software; the Free Software Foundation
7 dnl @ gives unlimited permission to copy and/or distribute it
8 dnl @ with or without modifications, as long as this notice
9 dnl @ is preserved.
10 undivert(`join.m4')dnl
11 dnl @result{}divert(`-1')
12 dnl @result{}# join(sep, args) - join each non-empty ARG into a single
13 dnl @result{}# string, with each element separated by SEP
14 dnl @result{}define(`join',
15 dnl @result{}`ifelse(`$#', `2', ``$2'',
16 dnl @result{}  `ifelse(`$2', `', `', ``$2'_')$0(`$1', shift(shift($@)))')')
17 dnl @result{}define(`_join',
18 dnl @result{}`ifelse(`$#$2', `2', `',
19 dnl @result{}  `ifelse(`$2', `', `', ``$1$2'')$0(`$1', shift(shift($@)))')')
20 dnl @result{}# joinall(sep, args) - join each ARG, including empty ones,
21 dnl @result{}# into a single string, with each element separated by SEP
22 dnl @result{}define(`joinall', ``$2'_$0(`$1', shift($@))')
23 dnl @result{}define(`_joinall',
24 dnl @result{}`ifelse(`$#', `2', `', ``$1$3'$0(`$1', shift(shift($@)))')')
25 dnl @result{}divert`'dnl