Add test for !LENGTH.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 10 Jun 2021 05:32:11 +0000 (22:32 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 10 Jun 2021 05:32:11 +0000 (22:32 -0700)
tests/language/control/define.at

index 0d4ef96b8240841c5832d902a5b8d6d6c0766ce1..c192beee0570ad464db7fefad20feabbeca40523 100644 (file)
@@ -391,4 +391,35 @@ xy.
 1234.
 123.])
 
-dnl 
+dnl Keep this test in sync with the examples for !LENGTH in the manual.
+PSPP_CHECK_MACRO_EXPANSION([!LENGTH],
+  [DEFINE !l()
+!LENGTH(123).
+!LENGTH(123.00).
+!LENGTH( 123 ).
+!LENGTH("123").
+!LENGTH(xyzzy).
+!LENGTH("xyzzy").
+!LENGTH("xy""zzy").
+!LENGTH(!UNQUOTE("xyzzy")).
+!LENGTH(!UNQUOTE("xy""zzy")).
+!LENGTH(!NULL).
+!ENDDEFINE.
+DEFINE !la(!positional !enclose('(',')'))
+!LENGTH(!1).
+!ENDDEFINE.],
+  [!l.
+!la(a b c).
+!la().],
+  [3.
+6.
+3.
+5.
+5.
+7.
+9.
+5.
+6.
+0.
+5.
+0.])