tests: Don't output to PDF without a good reason.
[pspp] / tests / language / expressions / evaluate.at
index ae7c89a5bb5335a1b519748ce8547ea71345dde8..cec32e76214d6c6bc260e19b2423346b189bb375 100644 (file)
@@ -1,4 +1,19 @@
-m4_define([CHECK_EXPR_EVAL],
+dnl PSPP - a program for statistical analysis.
+dnl Copyright (C) 2017 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation, either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
+dnl m4_define([CHECK_EXPR_EVAL],
   [AT_SETUP([expressions - $1])
    AT_DATA([evaluate.sps],
      [set mxwarn 1000.
@@ -10,8 +25,8 @@ DEBUG EVALUATE m4_argn(4, check)/[]m4_car(check).
 ])])
    AT_CAPTURE_FILE([evaluate.sps])
    m4_pushdef([i], [3])
-   AT_CHECK([pspp --testing-mode --error-file=- --no-output evaluate.sps], 
-     [m4_if(m4_bregexp([m4_foreach([check], [m4_shift($@)], [m4_argn(3, check)])], [error:]), [-1], [0], [1])], 
+   AT_CHECK([pspp --testing-mode --error-file=- --no-output evaluate.sps],
+     [m4_if(m4_bregexp([m4_foreach([check], [m4_shift($@)], [m4_argn(3, check)])], [error:]), [-1], [0], [1])],
      [stdout])
    # Use sed to transform "file:line.column:" into plain "file:line:",
    # because column numbers change between opt and noopt versions.
@@ -352,8 +367,19 @@ RND(number, number, number).]],
   [[trunc(1.9)], [1.00]],
   [[trunc(-1.2)], [-1.00]],
   [[trunc(-1.9)], [-1.00]],
+  [[trunc(5.06, .1)], [5.00]],
+  [[trunc(-5.06, .1)], [-5.00]],
+  [[trunc(1)], [1.00]],
+  [[trunc(1 - 2**-53)], [1.00]],
+  [[trunc(1 - 2**-52)], [1.00]],
+  [[trunc(1 - 2**-51)], [1.00]],
+  [[trunc(1 - 2**-45)], [0.00]],
+  [[trunc(1 - 2**-45, 1, 10)], [1.00]],
   [[trunc('x')], [error],
-   [error: DEBUG EVALUATE: Type mismatch invoking TRUNC(number) as trunc(string).]])
+   [error: DEBUG EVALUATE: Function invocation trunc(string) does not match any known function.  Candidates are:
+TRUNC(number)
+TRUNC(number, number)
+TRUNC(number, number, number).]])
 
 CHECK_EXPR_EVAL([acos arsin artan cos sin tan],
   [[acos(.5) / 3.14159 * 180], [60.00]],
@@ -1996,8 +2022,8 @@ AT_SETUP([LAG crash bug])
 AT_DATA([lag.sps], [dnl
 DATA LIST LIST /x.
 BEGIN DATA
-1 
-2 
+1
+2
 END DATA.
 
 DO IF (x <> LAG(x) ).
@@ -2094,10 +2120,10 @@ Table: Data List
 n,s,nlabel,slabel
 .,,,
 0,a,Very dissa,Wouldn't b
-1,b,Dissatisfi,Unhappy   @&t@
-2,c,Neutral   ,Bored     @&t@
-3,d,Satisfied ,Satiated  @&t@
-4,e,Very satis,Elated    @&t@
+1,b,Dissatisfi,Unhappy
+2,c,Neutral,Bored
+3,d,Satisfied,Satiated
+4,e,Very satis,Elated
 5,f,,
 6,g,,
 ])
@@ -2109,7 +2135,7 @@ DATA LIST NOTABLE/N1 TO N5 1-5.
 MISSING VALUES N1 TO N5 (3 THRU 5, 1).
 BEGIN DATA.
 12345
-6789 
+6789
 END DATA.
 
 COMPUTE P1=N1.
@@ -2158,7 +2184,7 @@ DATA LIST NOTABLE /N1 TO N5 1-5.
 MISSING VALUES N1 TO N5 (3 THRU 5, 1).
 BEGIN DATA.
 12345
-6789 
+6789
 END DATA.
 
 VECTOR N=N1 TO N5.