REREAD: Improve error messages and coding style.
[pspp] / tests / language / data-io / get-data-txt.at
index f1cd7615ec781bbce8d35fe83682043f0e8d269b..f09dbabc3c6d5409a4b0ddc15a728126b5675226 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
 dnl
@@ -161,7 +161,7 @@ AT_CLEANUP
 AT_SETUP([GET DATA /TYPE=TXT with empty trailing record])
 AT_DATA([get-data.sps], [dnl
 get data /type=txt /file=inline /arrangement=fixed /fixcase=2 /variables=
-       /1 x 0 f 
+       /1 x 0 f
            y 1 f.
 begin data.
 12
@@ -303,12 +303,10 @@ AT_CLEANUP
 dnl " (fixes Emacs highlighting)
 
 AT_SETUP([GET DATA /TYPE=TXT with IMPORTCASE])
-AT_CHECK([$PERL > test.data <<'EOF'
-for ($i = 1; $i <= 100; $i++) {
-    printf "%02d\n", $i;
-}
-EOF
-])
+AT_CHECK([$PYTHON3 > test.data -c '
+for i in range(1, 101):
+    print("%02d" % i)
+'])
 AT_DATA([get-data.sps], [dnl
 get data /type=txt /file='test.data' /importcase=first 10 /variables x f8.0.
 get data /type=txt /file='test.data' /importcase=percent 1 /variables x f8.0.
@@ -317,15 +315,25 @@ get data /type=txt /file='test.data' /importcase=percent 95 /variables x f8.0.
 get data /type=txt /file='test.data' /importcase=percent 100 /variables x f8.0.
 ])
 AT_CHECK([pspp -O format=csv get-data.sps], [0], [dnl
-get-data.sps:1: warning: GET DATA: Ignoring obsolete IMPORTCASES subcommand.  (N OF CASES or SAMPLE may be used to substitute.)
+"get-data.sps:1.39-1.57: warning: GET DATA: Ignoring obsolete IMPORTCASES subcommand.  (N OF CASES or SAMPLE may be used to substitute.).
+    1 | get data /type=txt /file='test.data' /importcase=first 10 /variables x f8.0.
+      |                                       ^~~~~~~~~~~~~~~~~~~"
 
-get-data.sps:2: warning: GET DATA: Ignoring obsolete IMPORTCASES subcommand.  (N OF CASES or SAMPLE may be used to substitute.)
+"get-data.sps:2.39-2.58: warning: GET DATA: Ignoring obsolete IMPORTCASES subcommand.  (N OF CASES or SAMPLE may be used to substitute.).
+    2 | get data /type=txt /file='test.data' /importcase=percent 1 /variables x f8.0.
+      |                                       ^~~~~~~~~~~~~~~~~~~~"
 
-get-data.sps:3: warning: GET DATA: Ignoring obsolete IMPORTCASES subcommand.  (N OF CASES or SAMPLE may be used to substitute.)
+"get-data.sps:3.39-3.59: warning: GET DATA: Ignoring obsolete IMPORTCASES subcommand.  (N OF CASES or SAMPLE may be used to substitute.).
+    3 | get data /type=txt /file='test.data' /importcase=percent 35 /variables x f8.0.
+      |                                       ^~~~~~~~~~~~~~~~~~~~~"
 
-get-data.sps:4: warning: GET DATA: Ignoring obsolete IMPORTCASES subcommand.  (N OF CASES or SAMPLE may be used to substitute.)
+"get-data.sps:4.39-4.59: warning: GET DATA: Ignoring obsolete IMPORTCASES subcommand.  (N OF CASES or SAMPLE may be used to substitute.).
+    4 | get data /type=txt /file='test.data' /importcase=percent 95 /variables x f8.0.
+      |                                       ^~~~~~~~~~~~~~~~~~~~~"
 
-get-data.sps:5: warning: GET DATA: Ignoring obsolete IMPORTCASES subcommand.  (N OF CASES or SAMPLE may be used to substitute.)
+"get-data.sps:5.39-5.60: warning: GET DATA: Ignoring obsolete IMPORTCASES subcommand.  (N OF CASES or SAMPLE may be used to substitute.).
+    5 | get data /type=txt /file='test.data' /importcase=percent 100 /variables x f8.0.
+      |                                       ^~~~~~~~~~~~~~~~~~~~~~"
 ])
 AT_CLEANUP