lexer: Reimplement for better testability and internationalization.
[pspp-builds.git] / tests / language / utilities / insert.at
index e119f1033bc4a5794dc54c6f965a11d91ab59a86..34376b1517c31902be8560e4824960005c59967e 100644 (file)
@@ -3,13 +3,13 @@ AT_BANNER([INSERT])
 dnl Create a file "batch.sps" that is valid syntax only in batch mode.
 m4_define([CREATE_BATCH_SPS], 
   [AT_DATA([batch.sps], [dnl
-input program.
-+  loop #i = 1 to 5.
-+    compute z = #i
-+    end case.
-+  end loop
-end file.
-end input program.
+input program
+loop #i = 1 to 5
++  compute z = #i
++  end case
+end loop
+end file
+end input program
 ])])
 
 AT_SETUP([INSERT SYNTAX=INTERACTIVE])
@@ -17,14 +17,13 @@ CREATE_BATCH_SPS
 AT_DATA([insert.sps], [dnl
 INSERT 
   FILE='batch.sps'
-  SYNTAX=INTERACTIVE.
+  SYNTAX=interactive.
 LIST.
 ])
 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
-batch.sps:2: error: INPUT PROGRAM: Syntax error at `+': expecting command name.
-batch.sps:3: error: INPUT PROGRAM: Syntax error at `+': expecting command name.
-batch.sps:5: error: INPUT PROGRAM: Syntax error at `+': expecting command name.
-batch.sps:7: error: Input program did not create any variables.
+batch.sps:2.1-2.4: error: INPUT PROGRAM: Syntax error at `loop': expecting end of command.
+batch.sps:3: error: COMPUTE: COMPUTE is allowed only after the active file has been defined or inside INPUT PROGRAM.
+batch.sps:4: error: END CASE: END CASE is allowed only inside INPUT PROGRAM.
 insert.sps:4: error: LIST: LIST is allowed only after the active file has been defined.
 ])
 AT_CLEANUP
@@ -111,24 +110,22 @@ END DATA.
 * The following line is erroneous
 
 DISPLAY AKSDJ.
+LIST.
 ])])
 
 AT_SETUP([INSERT ERROR=STOP])
 CREATE_ERROR_SPS
 AT_DATA([insert.sps], [INSERT FILE='error.sps' ERROR=STOP.
-LIST.
 ])
 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
 error.sps:10: error: DISPLAY: AKSDJ is not a variable name.
 warning: Error encountered while ERROR=STOP is effective.
-error.sps:10: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
 ])
 AT_CLEANUP
 
 AT_SETUP([INSERT ERROR=CONTINUE])
 CREATE_ERROR_SPS
 AT_DATA([insert.sps], [INSERT FILE='error.sps' ERROR=CONTINUE.
-LIST.
 ])
 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
 error.sps:10: error: DISPLAY: AKSDJ is not a variable name.
@@ -156,7 +153,7 @@ INSERT
 LIST.
 ])
 AT_CHECK([pspp -O format=csv insert.sps], [1], [dnl
-insert.sps:3: error: INSERT: Can't find `nonexistent' in include file search path.
+insert.sps:2: error: INSERT: Can't find `nonexistent' in include file search path.
 
 insert.sps:6: error: LIST: LIST is allowed only after the active file has been defined.
 ])