X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fdata-io%2Finpt-pgm.at;h=f5498855a75ea63365540ca45a00d71e7bcf8f87;hb=5748d685acc79667804acc7a1a5a09f0f6db47a8;hp=f048d3743fd44f881561354a3951929550c7849b;hpb=fe8dc2171009e90d2335f159d05f7e6660e24780;p=pspp diff --git a/tests/language/data-io/inpt-pgm.at b/tests/language/data-io/inpt-pgm.at index f048d3743f..f5498855a7 100644 --- a/tests/language/data-io/inpt-pgm.at +++ b/tests/language/data-io/inpt-pgm.at @@ -28,6 +28,55 @@ END INPUT PROGRAM. DESCRIPTIVES x. ]) AT_CHECK([pspp -O format=csv input-program.sps], [1], [dnl -error: DESCRIPTIVES: Syntax error at end of input: expecting `BEGIN'. +error: DESCRIPTIVES: Syntax error at end of input: expecting BEGIN. +]) +AT_CLEANUP + +dnl Tests for bug #38782, an infinite loop processing an empty input program. +AT_SETUP([INPUT PROGRAM infinite loop]) +AT_DATA([input-program.sps], [dnl +INPUT PROGRAM. +STRING firstname lastname (a24) / address (a80). +END INPUT PROGRAM. +EXECUTE. +]) +AT_CHECK([pspp -O format=csv input-program.sps], [1], [dnl +input-program.sps:3: error: Input program must contain DATA LIST or END FILE. + +input-program.sps:4: error: EXECUTE: EXECUTE is allowed only after the active dataset has been defined. +]) +AT_CLEANUP + +dnl Tests for bug #39097, a bug when an INPUT PROGRAM used VECTOR, was +dnl followed immediately by a call to proc_execute() (here via DATASET +dnl COPY), and then the input was actually used. +AT_SETUP([INPUT PROGRAM with VECTOR and EXECUTE]) +AT_DATA([input-program.sps], [dnl +INPUT PROGRAM. +VECTOR vec(5). +LOOP #c = 1 to 10. + LOOP #v = 1 to 5. + COMPUTE vec(#v) = #v. + END LOOP. + END CASE. +END LOOP. +END FILE. +END INPUT PROGRAM. +DATASET COPY x. +LIST. +]) +AT_CHECK([pspp -O format=csv input-program.sps], [0], [dnl +Table: Data List +vec1,vec2,vec3,vec4,vec5 +1.00,2.00,3.00,4.00,5.00 +1.00,2.00,3.00,4.00,5.00 +1.00,2.00,3.00,4.00,5.00 +1.00,2.00,3.00,4.00,5.00 +1.00,2.00,3.00,4.00,5.00 +1.00,2.00,3.00,4.00,5.00 +1.00,2.00,3.00,4.00,5.00 +1.00,2.00,3.00,4.00,5.00 +1.00,2.00,3.00,4.00,5.00 +1.00,2.00,3.00,4.00,5.00 ]) AT_CLEANUP