X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Fautorecode.at;h=6a8ff8e7316c224b478e8fa6ac5eb9c457be42c5;hb=db7019dcf6198f62053ac010f3b0ca12a6d93106;hp=bd9d59f7c45dfaa2259e7abe15c2e0684b0728c5;hpb=a258e53c63a08b0ec48aea8f03808eb651729424;p=pspp diff --git a/tests/language/stats/autorecode.at b/tests/language/stats/autorecode.at index bd9d59f7c4..6a8ff8e731 100644 --- a/tests/language/stats/autorecode.at +++ b/tests/language/stats/autorecode.at @@ -87,23 +87,16 @@ oojars ,5.00,1.00 thingummies ,6.00,3.00 oojimiflips ,7.00,2.00 -Variable,Description,,Position -s,Format: A16,,1 -,Measure: Nominal,, -,Display Alignment: Left,, -,Display Width: 16,, -x,Format: F8.2,,2 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, -new,Format: F8.2,,3 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, -,1,oojars, -,2,oojimiflips, -,3,thingummies, -,4,widgets, +Variable,Description,Position +s,Format: A16,1 +x,Format: F8.2,2 +new,"Format: F8.2 + +Value,Label +1.00,oojars +2.00,oojimiflips +3.00,thingummies +4.00,widgets",3 ]) AT_CLEANUP @@ -206,3 +199,76 @@ four ,nought,2.00,4.00 ]) AT_CLEANUP + + + +AT_SETUP([AUTORECODE /blank]) + +AT_DATA([auto-blank.sps], [dnl +data list notable list /x (a8) y * z (a16). +begin data. +one 2 fred +two 4 "" +"" 4 fred +"" 2 charliebrown +three 2 charliebrown +end data. + +autorecode variables x y z into a b c /blank=missing. + +list a b c y. +]) + +AT_CHECK([pspp -O format=csv auto-blank.sps], [0], [dnl +Table: Data List +a,b,c,y +1.00,1.00,2.00,2.00 +3.00,2.00,. ,4.00 +. ,2.00,2.00,4.00 +. ,1.00,1.00,2.00 +2.00,1.00,1.00,2.00 +]) + +AT_CLEANUP + +dnl AUTORECODE had a use-after-free error when TEMPORARY was in use. +dnl Bug #32757. +AT_SETUP([AUTORECODE with TEMPORARY]) +AT_DATA([autorecode.sps], + [data list /X 1-5(a) Y 7. +begin data. +lasdj 1 +asdfk 0 +asdfj 2 +asdfj 1 +asdfk 2 +asdfj 9 +lajks 9 +asdfk 0 +asdfk 1 +end data. + +temporary. +select if y > 1. +autorecode x y into A B/descend. +list. +]) +AT_CHECK([pspp -O format=csv autorecode.sps], [0], + [Table: Reading 1 record from INLINE. +Variable,Record,Columns,Format +X,1,1- 5,A5 +Y,1,7- 7,F1.0 + +Table: Data List +X,Y,A,B +lasdj,1,. ,. @&t@ +asdfk,0,2.00,. @&t@ +asdfj,2,3.00,2.00 +asdfj,1,3.00,. @&t@ +asdfk,2,2.00,2.00 +asdfj,9,3.00,1.00 +lajks,9,1.00,1.00 +asdfk,0,2.00,. @&t@ +asdfk,1,2.00,. @&t@ +]) +AT_CLEANUP