X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fdata%2Fpor-file.at;h=c23a047f31c88a7f7b02760b692e76faa1e0f238;hb=00aad3b983774328140a04436d7d6ae7925fec97;hp=e3ddab4bec7d33e3852f10ca5fdde4b8ed991ca3;hpb=a258e53c63a08b0ec48aea8f03808eb651729424;p=pspp diff --git a/tests/data/por-file.at b/tests/data/por-file.at index e3ddab4bec..c23a047f31 100644 --- a/tests/data/por-file.at +++ b/tests/data/por-file.at @@ -63,3 +63,113 @@ X,Y 2,4.00 ]) AT_CLEANUP + +dnl This checks for a bug in the portable file writer that caused an infinite +dnl loop in some cases, and other problems in other cases, when a variable +dnl had value labels. +AT_SETUP([write portable file with value labels]) +AT_DATA([export.sps], [dnl +DATA LIST NOTABLE/var1 TO var5 1-5. +VALUE LABELS + /var1 1 'one' + /var2 2 'two' + /var3 3 'three' + /var4 4 'four' + /var5 5 'five'. +BEGIN DATA. +12345 +END DATA. +EXPORT OUTFILE='data.por'. +]) +AT_CHECK([pspp -O format=csv export.sps]) +AT_DATA([import.sps], [dnl +IMPORT FILE='data.por'. +DISPLAY DICTIONARY. +LIST. +]) +AT_CHECK([pspp -O format=csv import.sps], [0], [dnl +Variable,Description,Position +VAR1,"Format: F1.0 + +Value,Label +1,one",1 +VAR2,"Format: F1.0 + +Value,Label +2,two",2 +VAR3,"Format: F1.0 + +Value,Label +3,three",3 +VAR4,"Format: F1.0 + +Value,Label +4,four",4 +VAR5,"Format: F1.0 + +Value,Label +5,five",5 + +Table: Data List +VAR1,VAR2,VAR3,VAR4,VAR5 +1,2,3,4,5 +]) +AT_DATA([sys-file-info.sps], [SYSFILE INFO FILE='data.por' +]) +AT_CHECK([pspp -O format=csv sys-file-info.sps | sed '/Encoding/d +/Integer Format/d +/Real Format/d +/Created/d +/Product/d +'], [0], [dnl +File:,data.por +Label:,No label. +Variables:,5 +Cases:,Unknown +Type:,SPSS Portable File +Weight:,Not weighted. +Compression:,None + +Variable,Description,Position +VAR1,"Format: F1.0 +Measure: Scale +Role: Input +Display Alignment: Right +Display Width: 8 + +Value,Label +1,one",1 +VAR2,"Format: F1.0 +Measure: Scale +Role: Input +Display Alignment: Right +Display Width: 8 + +Value,Label +2,two",2 +VAR3,"Format: F1.0 +Measure: Scale +Role: Input +Display Alignment: Right +Display Width: 8 + +Value,Label +3,three",3 +VAR4,"Format: F1.0 +Measure: Scale +Role: Input +Display Alignment: Right +Display Width: 8 + +Value,Label +4,four",4 +VAR5,"Format: F1.0 +Measure: Scale +Role: Input +Display Alignment: Right +Display Width: 8 + +Value,Label +5,five",5 +]) +AT_CLEANUP