+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([LIST])
AT_SETUP([LIST plain cases])
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Reading 1 record from `data.txt'.
Variable,Record,Columns,Format
-avar,1,1- 5,F5.0
-bvar,1,6- 10,F5.0
+avar,1,1-5,F5.0
+bvar,1,6-10,F5.0
Table: Data List
avar,bvar
DATA LIST FILE='data.txt'/avar 1-5 bvar 6-10.
WEIGHT BY bvar.
LIST/FORMAT NUMBERED.
+LIST/FORMAT NUMBERED/CASES FROM 2 TO 9 BY 2.
])
AT_CHECK([pspp -o pspp.csv list.sps])
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Reading 1 record from `data.txt'.
Variable,Record,Columns,Format
-avar,1,1- 5,F5.0
-bvar,1,6- 10,F5.0
+avar,1,1-5,F5.0
+bvar,1,6-10,F5.0
Table: Data List
Case Number,avar,bvar
9,26,30
10,27,21
11,28,23
+
+Table: Data List
+Case Number,avar,bvar
+2,19,7
+4,21,76
+6,23,58
+8,25,38
])
AT_CLEANUP
])
AT_CHECK([pspp -o pspp.csv list.sps])
AT_CHECK([cat pspp.csv], [0], [dnl
-Variable,Value,Label
-s,a,
+Table: Split Values
+Variable,Value
+s,a
Table: Data List
n
2.00
3.00
-Variable,Value,Label
-s,b,
+Table: Split Values
+Variable,Value
+s,b
Table: Data List
n
1.00
-Variable,Value,Label
-s,c,
+Table: Split Values
+Variable,Value
+s,c
Table: Data List
n
])
AT_CHECK([pspp -o pspp.csv list.sps])
AT_CHECK([cat pspp.csv], [0], [dnl
-Variable,Description,Position
-foo,Format: A2000,1
+Table: Variables
+Name,Position,Print Format,Write Format
+foo,1,A2000,A2000
Table: Data List
foo
AT_CHECK([pspp -o pspp.csv list.sps], [1], [ignore])
AT_CLEANUP
+
+dnl This is an example from doc/tutorial.texi
+dnl So if the results of this have to be changed in any way,
+dnl make sure to update that file.
+AT_SETUP([LIST tutorial example])
+AT_DATA([list.sps], [dnl
+data list list /forename (A12) height.
+begin data.
+Ahmed 188
+Bertram 167
+Catherine 134.231
+David 109.1
+end data
+
+list /format=numbered.
+])
+AT_CHECK([pspp -o pspp.csv -o pspp.txt list.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Reading free-form data from INLINE.
+Variable,Format
+forename,A12
+height,F8.0
+
+Table: Data List
+Case Number,forename,height
+1,Ahmed,188.00
+2,Bertram,167.00
+3,Catherine,134.23
+4,David,109.10
+])
+AT_CLEANUP