Add copyright and licence notices to files which lack them.
[pspp] / tests / language / dictionary / value-labels.at
index feec9d8627fa67149d787fea79ac62d90b585bb7..904803f65cd16cc442181b9a3fcc07765fc80d22 100644 (file)
@@ -1,4 +1,19 @@
-AT_BANNER([VALUE LABELS])
+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([VALUE LABELS])
 
 AT_SETUP([VALUE LABELS date formats])
 AT_DATA([value-labels.sps], [dnl
@@ -10,19 +25,84 @@ VALUE LABELS ad 'july 10, 1982' 'label 1'
 DISPLAY DICTIONARY.
 ])
 AT_CHECK([pspp -O format=csv value-labels.sps], [0], [dnl
-Variable,Description,,Position
-ad,Format: ADATE10,,1
-,Measure: Scale,,
-,Display Alignment: Right,,
-,Display Width: 8,,
-,07/10/1982,label 1,
-,01/02/1993,label 2,
-,05/04/2003,label 3,
-dt,Format: DATETIME20.0,,2
-,Measure: Scale,,
-,Display Alignment: Right,,
-,Display Width: 8,,
-,12-APR-2011 06:09:56,label 4,
+Variable,Description,Position
+ad,"Format: ADATE10
+
+Value,Label
+07/10/1982,label 1
+01/02/1993,label 2
+05/04/2003,label 3",1
+dt,"Format: DATETIME20.0
+
+Value,Label
+12-APR-2011 06:09:56,label 4",2
+])
+AT_CLEANUP
+
+AT_SETUP([VALUE LABELS with new-line])
+AT_DATA([value-labels.sps], [dnl
+DATA LIST LIST NOTABLE /x.
+VALUE LABELS x 1 'one' 2 'first line\nsecond line' 3 'three'.
+BEGIN DATA.
+1
+2
+3
+END DATA.
+DISPLAY DICTIONARY.
+FREQUENCIES x/STAT=NONE.
+])
+AT_CHECK([pspp -O format=csv value-labels.sps], [0], [dnl
+Variable,Description,Position
+x,"Format: F8.2
+
+Value,Label
+1.00,one
+2.00,first line\nsecond line
+3.00,three",1
+
+Table: x
+Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
+one,1.00,1,33.33,33.33,33.33
+"first line
+second line",2.00,1,33.33,33.33,66.67
+three,3.00,1,33.33,33.33,100.00
+Total,,3,100.0,100.0,
+])
+AT_CLEANUP
+
+AT_SETUP([VALUE LABELS with new-line in system file])
+AT_DATA([save.sps], [dnl
+DATA LIST LIST NOTABLE /x.
+VALUE LABELS x 1 'one' 2 'first line\nsecond line' 3 'three'.
+BEGIN DATA.
+1
+2
+3
+END DATA.
+SAVE OUTFILE='value-labels.sav'.
+])
+AT_CHECK([pspp -O format=csv save.sps])
+AT_DATA([get.sps], [dnl
+GET FILE='value-labels.sav'.
+DISPLAY DICTIONARY.
+FREQUENCIES x/STAT=NONE.
+])
+AT_CHECK([pspp -O format=csv get.sps], [0], [dnl
+Variable,Description,Position
+x,"Format: F8.2
+
+Value,Label
+1.00,one
+2.00,first line\nsecond line
+3.00,three",1
+
+Table: x
+Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
+one,1.00,1,33.33,33.33,33.33
+"first line
+second line",2.00,1,33.33,33.33,66.67
+three,3.00,1,33.33,33.33,100.00
+Total,,3,100.0,100.0,
 ])
 AT_CLEANUP