X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fexpressions%2Fparse.at;h=02b713f8b96aad762efa8cf8c5b1f60143639de1;hb=76e0b3df102f54672f8d4dfcc19c144e52a8ff4e;hp=e40a4fe873c3b910c53f8754134d1c1f42714b5e;hpb=ddd596e860006f3064dea11efe8d66d9d73659bd;p=pspp diff --git a/tests/language/expressions/parse.at b/tests/language/expressions/parse.at index e40a4fe873..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 @@ -88,6 +109,7 @@ DEBUG EVALUATE/ACOS(0)*0. ]) AT_CHECK([pspp --testing-mode --syntax=compatible -O format=csv parse.sps], [0], [dnl parse.sps:1: warning: DEBUG EVALUATE: ACOS(number) is a PSPP extension. + 0.00 ]) AT_CLEANUP