X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fcontrol%2Fdefine.at;h=9a7594b81bda47ca3d243dfe621f3449def4360d;hb=679339657851a4be1321d63a5a46f4d8a32926a4;hp=3c940c151380149e252bb4a7af7c17884f90b6f2;hpb=ee1bfc05f5ab73883df26e616019e07a1bfee873;p=pspp diff --git a/tests/language/control/define.at b/tests/language/control/define.at index 3c940c1513..9a7594b81b 100644 --- a/tests/language/control/define.at +++ b/tests/language/control/define.at @@ -1633,10 +1633,26 @@ not a multiple of 2. ]) AT_CLEANUP +AT_SETUP([macro name overlaps with macro function name]) +dnl !len is short for macro function !LENGTH. PSPP used to +dnl reject the following with "`(' expected following !LENGTH". +dnl Now PSPP only consider macro functions when the name is +dnl followed by '('. +AT_DATA([define.sps], [dnl +DEFINE !len() 5 !ENDDEFINE. +DEFINE !x() !eval(!len) !ENDDEFINE. +DEBUG EXPAND. +!x +]) +AT_CHECK([pspp -O format=csv define.sps --testing-mode], [0], [dnl +5 +]) +AT_CLEANUP + AT_SETUP([generic macro function syntax errors]) AT_DATA([define.sps], [dnl -DEFINE !a() !SUBSTR !ENDDEFINE. -DEFINE !b() !SUBSTR x !ENDDEFINE. + + DEFINE !c() !SUBSTR(1x) !ENDDEFINE. DEFINE !d() !SUBSTR(1 !ENDDEFINE. DEFINE !narg_blanks() !BLANKS() !ENDDEFINE. @@ -1653,8 +1669,8 @@ DEFINE !narg_unquote() !UNQUOTE() !ENDDEFINE. DEFINE !narg_upcase() !UPCASE() !ENDDEFINE. dnl ) DEBUG EXPAND. -!a. -!b. + + !c. !d. !narg_blanks. @@ -1671,16 +1687,6 @@ DEBUG EXPAND. !narg_upcase. ]) AT_CHECK([pspp --testing-mode define.sps], [1], [dnl -define.sps:1: In the expansion of `!a', -define.sps:18.1-18.2: error: DEBUG EXPAND: `@{:@' expected following !SUBSTR. - -!SUBSTR - -define.sps:2: At `x' in the expansion of `!b', -define.sps:19.1-19.2: error: DEBUG EXPAND: `@{:@' expected following !SUBSTR. - -!SUBSTR x - define.sps:3: At `x' in the expansion of `!c', define.sps:20.1-20.2: error: DEBUG EXPAND: `,' or `@:}@' expected in call to macro function !SUBSTR.