X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Futilities%2Finsert.at;h=8867ac28c19e6e06b9cfe231a8666eeaab6cb0cd;hb=ab19e5378e9509be1beaf5c1ca837c1acf69e764;hp=8eaa72f7262e3f387d366901b2842035409371de;hpb=fe8dc2171009e90d2335f159d05f7e6660e24780;p=pspp diff --git a/tests/language/utilities/insert.at b/tests/language/utilities/insert.at index 8eaa72f726..8867ac28c1 100644 --- a/tests/language/utilities/insert.at +++ b/tests/language/utilities/insert.at @@ -1,7 +1,23 @@ +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([INSERT]) dnl Create a file "batch.sps" that is valid syntax only in batch mode. -m4_define([CREATE_BATCH_SPS], +m4_define([CREATE_BATCH_SPS], [AT_DATA([batch.sps], [dnl input program loop #i = 1 to 5 @@ -15,7 +31,7 @@ end input program AT_SETUP([INSERT SYNTAX=INTERACTIVE]) CREATE_BATCH_SPS AT_DATA([insert.sps], [dnl -INSERT +INSERT FILE='batch.sps' SYNTAX=interactive. LIST. @@ -31,7 +47,7 @@ AT_CLEANUP AT_SETUP([INSERT SYNTAX=BATCH]) CREATE_BATCH_SPS AT_DATA([insert.sps], [dnl -INSERT +INSERT FILE='batch.sps' SYNTAX=BATCH. LIST. @@ -145,7 +161,7 @@ dnl Test for regression against bug #24569 in which PSPP crashed dnl upon attempt to insert a nonexistent file. AT_SETUP([INSERT nonexistent file]) AT_DATA([insert.sps], [dnl -INSERT +INSERT FILE='nonexistent' ERROR=CONTINUE. . @@ -158,3 +174,39 @@ insert.sps:2: error: INSERT: Can't find `nonexistent' in include file search pat insert.sps:6: error: LIST: LIST is allowed only after the active dataset has been defined. ]) AT_CLEANUP + + +dnl A test to check the INCLUDE command complete with the +dnl syntax and function of the ENCODING subcommand. +AT_SETUP([INCLUDE full check]) +AT_DATA([two-utf8.sps], [dnl +echo 'Äpfelfölfaß'. +]) + +AT_DATA([include.sps], [dnl +echo 'ONE'. + +include FILE='two-latin1.sps' ENCODING='ISO_8859-1'. +]) + +AT_CHECK([iconv -f UTF-8 -t iso-8859-1 two-utf8.sps > two-latin1.sps], [0], []) + +AT_CHECK([pspp -O format=csv include.sps], [0], [dnl +ONE + +Äpfelfölfaß +]) +AT_CLEANUP + + + + +dnl Test for a bug where insert crashed on an unterminated string input +AT_SETUP([INSERT unterminated string]) + +AT_DATA([insert.sps], [INSERT FILE=7bar.sps' CD=NO. +]) + +AT_CHECK([pspp -O format=csv insert.sps], [1], [ignore]) + +AT_CLEANUP