From: Ben Pfaff Date: Tue, 26 Apr 2011 04:37:18 +0000 (-0700) Subject: sys-file: Add test to write non-ASCII to most .sav string fields. X-Git-Tag: v0.7.8~32 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b84ba63c22f65fffebf1dec32a982be2d5a83536;p=pspp-builds.git sys-file: Add test to write non-ASCII to most .sav string fields. Bug #33036. --- diff --git a/tests/data/sys-file.at b/tests/data/sys-file.at index 5bd505c1..a2980853 100644 --- a/tests/data/sys-file.at +++ b/tests/data/sys-file.at @@ -379,3 +379,78 @@ d,Format: A32767,,4 VLS_WRITE([UNCOMPRESSED]) VLS_WRITE([COMPRESSED]) + +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_DATA([save.sps], [dnl +SET LOCALE='windows-1252'. +DATA LIST LIST NOTABLE /àéîöç * roué (A9) croûton (A1000). +FILE LABEL 'clientèle confrère cortège crèche'. +DOCUMENT coördinate smörgåsbord +épée séance soufflé soirée +jalapeño vicuña. +VALUE LABEL + /àéîöç 1 'éclair élan' + /roué 'abcdefghi' 'sauté précis'. +VARIABLE LABEL + roué 'Provençal soupçon'. +DATAFILE ATTRIBUTE + ATTRIBUTE=Furtwängler('kindergärtner'). +VARIABLE ATTRIBUTE + VARIABLES=àéîöç + ATTRIBUTE=Atatürk('Düsseldorf Gewürztraminer'). +BEGIN DATA. +1 a x +2 b y +3 c z +END DATA. +SAVE OUTFILE='foo.sav'. +]) +AT_CHECK([pspp -O format=csv save.sps]) +AT_DATA([get.sps], [dnl +GET FILE='foo.sav'. +DISPLAY FILE LABEL. +DISPLAY DOCUMENTS. +DISPLAY DICTIONARY. +]) +AT_CHECK([pspp -o pspp.csv get.sps]) +AT_CHECK([[sed 's/(Entered [^)]*)/(Entered )/' pspp.csv]], [0], [dnl +File label: clientèle confrère cortège crèche + +Documents in the active dataset: + +DOCUMENT coördinate smörgåsbord + +épée séance soufflé soirée + +jalapeño vicuña. + +(Entered ) + +Variable,Description,,Position +àéîöç,Format: F8.2,,1 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +,1.00,éclair élan, +,Custom attributes:,, +,Atatürk,Düsseldorf Gewürztraminer, +roué,Provençal soupçon,,2 +,Format: A9,, +,Measure: Nominal,, +,Display Alignment: Left,, +,Display Width: 9,, +,abcdefghi,sauté précis, +croûton,Format: A1000,,3 +,Measure: Nominal,, +,Display Alignment: Left,, +,Display Width: 32,, + +Table: Custom data file attributes. +Attribute,Value +Furtwängler,kindergärtner +]) +AT_CLEANUP