Add copyright and licence notices to files which lack them.
[pspp] / tests / language / control / do-if.at
index 45f696a3b7c13551df94f01661c77ceb71091a4d..3e67de2d86df538b3db05eb1b34e53e5814a0b33 100644 (file)
@@ -1,4 +1,19 @@
-AT_BANNER([DO IF])
+dnl PSPP - a program for statistical analysis.
+dnl Copyright (C) 2017 Free Software Foundation, Inc.
+dnl 
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation, either version 3 of the License, or
+dnl (at your option) any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
+dnl AT_BANNER([DO IF])
 
 AT_SETUP([DO IF])
 (for a in 0 1 ' '; do
@@ -48,3 +63,35 @@ EXECUTE.
 AT_CHECK([pspp do-if.sps], [0], [ignore])
 AT_CHECK([cat do-if.out], [0], [expout])
 AT_CLEANUP
+
+AT_SETUP([unpaired END IF crash])
+AT_DATA([do-if.sps], [dnl
+DATA LIST LIST NOTABLE/a b c.
+END IF.
+])
+AT_CHECK([pspp -O format=csv do-if.sps], [1], [dnl
+do-if.sps:2: error: END IF: This command cannot appear outside DO IF...END IF.
+])
+AT_CLEANUP
+
+
+
+AT_SETUP([ELSE without DO IF])
+AT_DATA([do-if.sps], [dnl
+DATA lIST NOTABLE LIST /QUA BRA *.
+BEGIN DATA
+4  1
+6  3
+END DATA
+
+ELSE QUA 'A string'.
+
+EXECUTE.
+])
+AT_CHECK([pspp -O format=csv do-if.sps], [1], [dnl
+do-if.sps:7: error: ELSE: This command cannot appear outside DO IF...END IF.
+
+do-if.sps:9: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
+])
+AT_CLEANUP
+