X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fcontrol%2Floop.at;h=a2ceac3de350ef79cc899bd4fcb2c0af7546177a;hb=ddd596e860006f3064dea11efe8d66d9d73659bd;hp=60baac7e9c785af928ebbbc4488524008dba2e6b;hpb=5dbf5abcbed01f04422d4dead1c0ae0bb7efde4f;p=pspp diff --git a/tests/language/control/loop.at b/tests/language/control/loop.at index 60baac7e9c..a2ceac3de3 100644 --- a/tests/language/control/loop.at +++ b/tests/language/control/loop.at @@ -1,16 +1,16 @@ dnl PSPP - a program for statistical analysis. dnl Copyright (C) 2017 Free Software Foundation, Inc. -dnl +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 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 dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . dnl @@ -38,25 +38,15 @@ execute. AT_CHECK([pspp -o pspp.csv loop.sps]) AT_CHECK([cat pspp.csv], [0], [dnl 1.00 @&t@ - 2.00 @&t@ - -------- - 2.00 @&t@ - 4.00 @&t@ - -------- - 3.00 @&t@ - 6.00 @&t@ - 9.00 @&t@ - -------- - -------- ]) AT_CLEANUP @@ -75,25 +65,15 @@ execute. AT_CHECK([pspp -o pspp.csv loop.sps]) AT_CHECK([cat pspp.csv], [0], [dnl 1.00 @&t@ - 2.00 @&t@ - -------- - 2.00 @&t@ - 4.00 @&t@ - -------- - 3.00 @&t@ - 6.00 @&t@ - 9.00 @&t@ - -------- - -------- ]) AT_CLEANUP @@ -112,27 +92,16 @@ execute. AT_CHECK([pspp -o pspp.csv loop.sps]) AT_CHECK([cat pspp.csv], [0], [dnl 1.00 @&t@ - 2.00 @&t@ - -------- - 2.00 @&t@ - 4.00 @&t@ - -------- - 3.00 @&t@ - 6.00 @&t@ - 9.00 @&t@ - -------- - 4.00 @&t@ - -------- ]) AT_CLEANUP @@ -149,19 +118,12 @@ execute. AT_CHECK([pspp -o pspp.csv loop.sps]) AT_CHECK([cat pspp.csv], [0], [dnl 1.00 @&t@ - 2.00 @&t@ - -------- - 2.00 @&t@ - -------- - 3.00 @&t@ - -------- - -------- ]) AT_CLEANUP @@ -178,23 +140,14 @@ execute. AT_CHECK([pspp -o pspp.csv loop.sps]) AT_CHECK([cat pspp.csv], [0], [dnl 1.00 @&t@ - 2.00 @&t@ - -------- - 2.00 @&t@ - 4.00 @&t@ - -------- - 3.00 @&t@ - 6.00 @&t@ - -------- - -------- ]) AT_CLEANUP @@ -211,15 +164,10 @@ execute. AT_CHECK([pspp -o pspp.csv loop.sps]) AT_CHECK([cat pspp.csv], [0], [dnl -------- - 2.00 @&t@ - 4.00 @&t@ - -------- - -------- - -------- ]) AT_CLEANUP @@ -241,23 +189,14 @@ execute. AT_CHECK([pspp -o pspp.csv loop.sps]) AT_CHECK([cat pspp.csv], [0], [dnl 1.00 @&t@ - -------- - 2.00 @&t@ - 4.00 @&t@ - -------- - 3.00 @&t@ - 6.00 @&t@ - -------- - 4.00 @&t@ - -------- ]) AT_CLEANUP @@ -276,28 +215,48 @@ execute. AT_CHECK([pspp -o pspp.csv loop.sps]) AT_CHECK([cat pspp.csv], [0], [dnl 1 1.00 @&t@ - 1 2.00 @&t@ - -------- - 2 3.00 @&t@ - 2 4.00 @&t@ - -------- - 3 5.00 @&t@ - 3 6.00 @&t@ - -------- - 4 7.00 @&t@ - 4 8.00 @&t@ - -------- ]) AT_CLEANUP +AT_SETUP([LOOP with IF condition that ends due to MXLOOPS]) +AT_DATA([loop.sps], [dnl +LOOP_DATA +set mxloops=3. +compute #p = x. +loop. +print /x #p. +compute #p = #p + 1. +end loop if #p >= 6. +print/'--------'. +execute. +]) +AT_CHECK([pspp -o pspp.csv loop.sps]) +AT_CHECK([cat pspp.csv], [0], [dnl +1 1.00 @&t@ +1 2.00 @&t@ +1 3.00 @&t@ +-------- +2 2.00 @&t@ +2 3.00 @&t@ +2 4.00 @&t@ +-------- +3 3.00 @&t@ +3 4.00 @&t@ +3 5.00 @&t@ +-------- +4 4.00 @&t@ +4 5.00 @&t@ +-------- +]) +AT_CLEANUP