X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fexpressions%2Fparse.at;h=02b713f8b96aad762efa8cf8c5b1f60143639de1;hb=db8e899446fa2679235ce3091dc4eebe33429a99;hp=8e4166c5992493103034b78c2e635e4a5b9eb61c;hpb=8a490bdb254cf8d37eb4ac4edf91c7ef933c92dd;p=pspp diff --git a/tests/language/expressions/parse.at b/tests/language/expressions/parse.at index 8e4166c599..02b713f8b9 100644 --- a/tests/language/expressions/parse.at +++ b/tests/language/expressions/parse.at @@ -38,13 +38,23 @@ parse.sps:11: error: Stopping syntax file processing here to avoid a cascade of ]) AT_CLEANUP -AT_SETUP([parsing numeric expression with type mismatch]) +AT_SETUP([parsing boolean expression with type mismatch]) AT_DATA([parse.sps], [dnl DATA LIST NOTABLE/x 1(A). IF 'foo'. ]) AT_CHECK([pspp -O format=csv parse.sps], [1], [dnl -"parse.sps:2: error: IF: Type mismatch: expression has string type, but a numeric value is required here." +"parse.sps:2: error: IF: Type mismatch: expression has string type, but a boolean value is required here." +]) +AT_CLEANUP + +AT_SETUP([parsing numeric expression with type mismatch]) +AT_DATA([parse.sps], [dnl +DATA LIST NOTABLE/x 1. +COMPUTE x='foo'. +]) +AT_CHECK([pspp -O format=csv parse.sps], [1], [dnl +"parse.sps:2: error: COMPUTE: Type mismatch: expression has string type, but a numeric value is required here." ]) AT_CLEANUP @@ -59,6 +69,17 @@ AT_CHECK([pspp -O format=csv parse.sps], [1], [dnl ]) AT_CLEANUP +AT_SETUP([assigning string expression to new variable]) +AT_KEYWORDS([expression negative]) +AT_DATA([parse.sps], [dnl +DATA LIST NOTABLE/x 1(A). +COMPUTE y='a'. +]) +AT_CHECK([pspp -O format=csv parse.sps], [1], [dnl +"parse.sps:2: error: COMPUTE: This command tries to create a new variable y by assigning a string value to it, but this is not supported. Use the STRING command to create the new variable with the correct width before assigning to it, e.g. STRING y(A20)." +]) +AT_CLEANUP + AT_SETUP([parse expression with unknown system variable]) AT_KEYWORDS([expression negative]) AT_DATA([parse.sps], [dnl