X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fdata-io%2Fmatch-files.at;h=89f81e63659dcf6647085f9f354fbf7abb585ed5;hb=refs%2Fheads%2Fctables10;hp=ce429a81e8f9b696cf78eec0bb626012c52c1597;hpb=b401615e6db40bf74394839b96600afe3a868a95;p=pspp diff --git a/tests/language/data-io/match-files.at b/tests/language/data-io/match-files.at index ce429a81e8..89f81e6365 100644 --- a/tests/language/data-io/match-files.at +++ b/tests/language/data-io/match-files.at @@ -1,3 +1,19 @@ +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 . +dnl AT_BANNER([MATCH FILES]) m4_define([PREPARE_MATCH_FILES], @@ -48,7 +64,7 @@ dnl dnl - SOURCE2: Either "system" or "active" for the source of data for dnl the second data source. (SOURCE1 and SOURCE2 may not both be dnl "active".) -m4_define([CHECK_MATCH_FILES], +m4_define([CHECK_MATCH_FILES], [AT_SETUP([MATCH FILES -- $2 file and $3 $1]) PREPARE_MATCH_FILES AT_DATA([expout], @@ -198,3 +214,33 @@ x,y,j 2.00,3.00,55.00 ]) AT_CLEANUP + +dnl Tests for a bug that caused MATCH FILES to crash +dnl with incompatible variables, especially but not +dnl exclusively when one variable came from the active +dnl file. +AT_SETUP([MATCH FILES with incompatible variable types]) +AT_DATA([match-files.sps], [dnl +DATA LIST LIST NOTABLE/name (A6) x. +BEGIN DATA. +al,7 +brad,8 +carl,9 +END DATA. +SAVE OUTFILE='x.sav'. + +DATA LIST LIST NOTABLE/name (A7) y. +BEGIN DATA. +al,1 +carl,2 +dan,3 +END DATA. +MATCH FILES/FILE='x.sav'/FILE=*/BY name. +LIST. +]) +AT_CHECK([pspp -O format=csv match-files.sps], [1], [dnl +"match-files.sps:15: error: MATCH FILES: Variable name in file * has different type or width from the same variable in earlier file. In file *, name is a string variable with width 7. In an earlier file, name was a string variable with width 6." + +match-files.sps:16: error: Stopping syntax file processing here to avoid a cascade of dependent command failures. +]) +AT_CLEANUP