!*
[pspp] / tests / language / control / define.at
index bf5e2c4ae11dbaa0cabe39e9960bc1d83246e9aa..bbf3ba26fc5d85478393b97c1033d8d4c467a0c6 100644 (file)
@@ -87,7 +87,7 @@ cmd2(!1, !2)
 DEFINE !p(!positional !tokens(1)
          /!positional !tokens(1)
         /!positional !tokens(1))
-p(!1, !2, !3)
+p(!1, !2, !3)(!*)
 !ENDDEFINE.
 
 DEBUG EXPAND.
@@ -175,9 +175,9 @@ cmd2(5 6, 7)
 
 "Three !TOKENS(1) arguments."
 
-p(a, b, c)
+p(a, b, c) (a b c)
 
-p(1, -2, -3)
+p(1, -2, -3) (1 -2 -3)
 ])
 AT_CLEANUP
 \f
@@ -533,3 +533,20 @@ FRECKLE.
 A B C.
 A B C.])
 
+
+dnl !* is implemented separately inside and outside function arguments
+dnl so this test makes sure to include both.
+PSPP_CHECK_MACRO_EXPANSION([!*], [dnl
+DEFINE !m(!POSITIONAL !TOKENS(1)
+         /!POSITIONAL !TOKENS(1))
+!*/
+!LENGTH(!*)/
+!SUBSTR(!*, 3)/
+!QUOTE(!*).
+!ENDDEFINE.],
+  [!m 123 b
+!m 2 3
+!m '' 'b'.
+], [123 b / 5 / 3 b / '123 b'.
+2 3 / 3 / 3 / '2 3'.
+'' 'b' / 6 / 'b' / ''''' ''b'''.])
\ No newline at end of file