SET MXWARNS = 0 to be interpreted as unlimited.
[pspp] / tests / language / utilities / set.at
index 851642ebdcb36cdc57ecd9a6e8e0eb291c94bb28..e1b92573f31e910e32540d3846d54e85fdf21a05 100644 (file)
@@ -20,3 +20,75 @@ Variable,N,Mean,Std Dev,Minimum,Maximum
 x,3,2.00,1.00,1.00,3.00
 ])
 AT_CLEANUP
+
+
+
+AT_SETUP([SET MXWARNS])
+dnl Make sure that syntax processing stops and that
+dnl a warning is issued when the MXWARNS figure is
+dnl exceeded.
+AT_DATA([set.pspp], [dnl
+set mxwarns=2.
+data list notable list /x (f8.2) y (f8.2).
+begin data
+1 2
+3 r
+5 x
+q 8
+9 9
+3 x
+w w
+end data.
+
+comment The following line should not be executed.
+list.
+])
+
+AT_CHECK([pspp -O format=csv set.pspp], [0], [dnl
+"set.pspp:5: warning: (column 3, F field) Field contents are not numeric."
+
+"set.pspp:6: warning: (column 3, F field) Field contents are not numeric."
+
+"set.pspp:7: warning: (column 1, F field) Field contents are not numeric."
+
+note: Warnings (3) exceed limit (2).  Syntax processing will be halted.
+])
+
+AT_CLEANUP
+
+
+
+
+AT_SETUP([SET MXWARNS special case zero])
+dnl Make sure that MXWARNS interprets zero as infinity.
+AT_DATA([mxwarns.pspp], [dnl
+set mxwarns=0.
+data list notable list /x (f8.2) y (f8.2) z *.
+begin data
+1 2 3
+3 r 3
+5 x 3
+q 8 4
+9 9 4
+3 x 4
+w w 4
+end data.
+
+list.
+])
+
+AT_CHECK([pspp -O format=csv mxwarns.pspp], [0],
+[warning: MXWARNS set to zero.  No further warnings will be given even when potentially problematic situations are encountered.
+
+Table: Data List
+x,y,z
+1.00,2.00,3.00
+3.00,.  ,3.00
+5.00,.  ,3.00
+.  ,8.00,4.00
+9.00,9.00,4.00
+3.00,.  ,4.00
+.  ,.  ,4.00
+])
+
+AT_CLEANUP