SYSFILE INFO: Improve output formatting by using nested tables.
[pspp] / tests / language / data-io / list.at
index f8b3bb5c3bb6323eda932692a6a81aed6a68003c..6716354ccfd0782c725196e153ef0805dc2818dc 100644 (file)
@@ -84,6 +84,50 @@ Case Number,avar,bvar
 ])
 AT_CLEANUP
 
+# Checks for a crash when LIST did not include the variables from SPLIT
+# FILE in the same positions (bug #30684).
+AT_SETUP([LIST with split file])
+AT_DATA([data.txt], [dnl
+a 1
+a 2
+a 3
+b 1
+c 4
+c 5
+])
+AT_DATA([list.sps], [dnl
+DATA LIST LIST NOTABLE FILE='data.txt'/s (a1) n.
+SPLIT FILE BY s.
+LIST n.
+])
+AT_CHECK([pspp -o pspp.csv list.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Variable,Value,Label
+s,a,
+
+Table: Data List
+n
+1.00
+2.00
+3.00
+
+Variable,Value,Label
+s,b,
+
+Table: Data List
+n
+1.00
+
+Variable,Value,Label
+s,c,
+
+Table: Data List
+n
+4.00
+5.00
+])
+AT_CLEANUP
+
 AT_SETUP([LIST lots of variables])
 AT_DATA([data.txt], [dnl
 767532466348513789073483106409
@@ -140,17 +184,15 @@ AT_DATA([data.txt], [dnl
 ])
 AT_DATA([list.sps], [dnl
 DATA LIST FILE='data.txt' NOTABLE/x0 to x9 1-10.
-LIST /CASES=FROM 1 TO 25 BY 5.
+LIST /CASES=FROM 6 TO 20 BY 5.
 ])
 AT_CHECK([pspp -o pspp.csv list.sps])
 AT_CHECK([cat pspp.csv], [0], [dnl
 Table: Data List
 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
-7,6,7,5,3,2,4,6,6,3
 2,3,9,9,6,1,9,6,7,0
 2,2,8,4,5,3,4,0,8,3
 6,8,2,1,5,6,7,7,4,6
-7,9,7,0,6,2,0,0,9,1
 ])
 AT_CLEANUP
 
@@ -173,11 +215,8 @@ LIST.
 ])
 AT_CHECK([pspp -o pspp.csv list.sps])
 AT_CHECK([cat pspp.csv], [0], [dnl
-Variable,Description,,Position
-foo,Format: A2000,,1
-,Measure: Nominal,,
-,Display Alignment: Left,,
-,Display Width: 32,,
+Variable,Description,Position
+foo,Format: A2000,1
 
 Table: Data List
 foo