X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Flanguage%2Fstats%2Fautorecode.at;h=c3d8d3cc7745e4ca2396059a46640eec58bb0a3b;hb=cb00cc9f9dc738f2850cd4b5a9776031f87de8a2;hp=6f112def33c1427f175366e63cf443371c78eb3c;hpb=fb763770be9335ecdda998155febc58b795c7bfe;p=pspp diff --git a/tests/language/stats/autorecode.at b/tests/language/stats/autorecode.at index 6f112def33..c3d8d3cc77 100644 --- a/tests/language/stats/autorecode.at +++ b/tests/language/stats/autorecode.at @@ -100,10 +100,140 @@ new,Format: F8.2,,3 ,Measure: Scale,, ,Display Alignment: Right,, ,Display Width: 8,, -,1,oojars, -,2,oojimiflips, -,3,thingummies, -,4,widgets, +,1.00,oojars, +,2.00,oojimiflips, +,3.00,thingummies, +,4.00,widgets, +]) + +AT_CLEANUP + + +AT_SETUP([AUTORECODE group subcommand]) +AT_DATA([ar-group.sps], +[data list notable list /x * y *. +begin data. +11 10 +12 12 +13 15 +14 11 +15 12 +16 18 +end data. + +autorecode + x y into a b + /group. + +list. +]) + +AT_CHECK([pspp -O format=csv ar-group.sps], [0], +[Table: Data List +x,y,a,b +11.00,10.00,2.00,1.00 +12.00,12.00,3.00,3.00 +13.00,15.00,4.00,6.00 +14.00,11.00,5.00,2.00 +15.00,12.00,6.00,3.00 +16.00,18.00,7.00,8.00 +]) + +AT_CLEANUP + + + +AT_SETUP([AUTORECODE group - string variables]) +AT_DATA([strings.sps], +[data list notable list /x (a8) y (a16). +begin data. +fred bert +charlie " " +delta echo +" " windows +" " nothing +end data. + + +autorecode x y into a b + /group. + +delete variables x y. + +list. + +]) + +AT_CHECK([pspp -O format=csv strings.sps], [0], +[Table: Data List +a,b +7.00,3.00 +4.00,1.00 +5.00,6.00 +2.00,9.00 +2.00,8.00 +]) + +AT_CLEANUP + + +dnl Tests for a crash which happened when the /GROUP subcommand +dnl appeared with string variables of different widths. +AT_SETUP([AUTORECODE group vs. strings]) +AT_DATA([ar-strings.sps], + [data list notable list /a (a12) b (a6). +begin data. +one nine +two ten +three eleven +four nought +end data. + +autorecode a b into x y + /group. + +list. +]) + +AT_CHECK([pspp -O format=csv ar-strings.sps], [0], +[dnl +Table: Data List +a,b,x,y +one ,nine ,5.00,3.00 +two ,ten ,8.00,6.00 +three ,eleven,7.00,1.00 +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