sys-file-reader: Add support for long string missing values.
[pspp] / tests / data / sys-file.at
index 5975e0f3b7326c4e44e8141d735d64c418648b97..cd7fbb4f50a168897a0b84dc8328547e1a575738 100644 (file)
@@ -37,6 +37,57 @@ variable001,variable002,variable003,variable004
 ])
 AT_CLEANUP
 
+AT_SETUP([write and read long string value labels and missing values])
+AT_DATA([sysfile.sps], [dnl
+DATA LIST LIST NOTABLE/s1 s2 s3 (a9).
+BEGIN DATA
+a b c
+END DATA.
+
+VALUE LABELS
+    /s1 'abc' 'First value label'
+       'abcdefgh' 'Second value label'
+       'abcdefghi' 'Third value label'
+    /s2 '0' 'Fourth value label'
+       '01234567' 'Fifth value label'
+       '012345678' 'Sixth value label'.
+
+MISSING VALUES
+     s1 ('0')
+    /s2 ('12' '123')
+    /s3 ('1234' '12345' '12345678').
+
+SAVE /OUTFILE='foo.sav'.
+GET /FILE='foo.sav'.
+DISPLAY DICTIONARY.
+])
+AT_CHECK([pspp -o pspp.csv sysfile.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Variable,Description,,Position
+s1,Format: A9,,1
+,Measure: Nominal,,
+,Display Alignment: Left,,
+,Display Width: 9,,
+,"Missing Values: ""0       """,,
+,abc      ,First value label,
+,abcdefgh ,Second value label,
+,abcdefghi,Third value label,
+s2,Format: A9,,2
+,Measure: Nominal,,
+,Display Alignment: Left,,
+,Display Width: 9,,
+,"Missing Values: ""12      ""; ""123     """,,
+,0        ,Fourth value label,
+,01234567 ,Fifth value label,
+,012345678,Sixth value label,
+s3,Format: A9,,3
+,Measure: Nominal,,
+,Display Alignment: Left,,
+,Display Width: 9,,
+,"Missing Values: ""1234    ""; ""12345   ""; ""12345678""",,
+])
+AT_CLEANUP
+
 AT_SETUP([write and read compressed files])
 AT_KEYWORDS([SAVE GET system file])
 AT_DATA([sysfile.sps], [dnl
@@ -384,7 +435,7 @@ dnl This test writes non-ASCII characters to most of the string fields in
 dnl a .sav file and demonstrates that they are properly read back in.
 dnl XXX mrsets tests are missing.
 AT_SETUP([system file character encoding])
-AT_CHECK([supports_encodings windows-1252])
+AT_CHECK([i18n-test supports_encodings windows-1252])
 AT_DATA([save.sps], [dnl
 SET LOCALE='windows-1252'.
 DATA LIST LIST NOTABLE /àéîöçxyzabc * roué (A9) croûton (A1000).