Merge remote-tracking branch 'origin/master' into sheet
[pspp] / tests / language / data-io / get-data-txt.at
index 9e01aae3744f921ac26b304e78b8bd62a6b6bfc9..25d7d6b93dce48ad336fc9a22d1878568ef0a3e1 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
+dnl
 AT_BANNER([GET DATA /TYPE=TXT])
 
 dnl These tests exercise features of GET DATA /TYPE=TXT that
@@ -329,3 +345,75 @@ s
 é      @&t@
 ])
 AT_CLEANUP
+
+
+AT_SETUP([GET DATA /TYPE= truncated])
+
+AT_DATA([x.sps], [dnl
+GET DATA /TYPE=
+.
+])
+
+AT_CHECK([pspp -o pspp.csv x.sps], [1], [ignore])
+
+AT_CLEANUP
+
+
+
+AT_SETUP([GET DATA /TYPE=txt bug])
+
+
+AT_DATA([thing.txt], [dnl
+foo, title, last
+1, this, 1
+2, that, 2
+3, other, 3
+])
+
+AT_DATA([x.sps], [dnl
+GET DATA
+  /TYPE=TXT
+  /FILE="thing.txt"
+  /ARRANGEMENT=DELIMITED
+  /DELCASE=LINE
+  /FIRSTCASE=2
+  /DELIMITERS=","
+  /VARIABLES=foo F1.0
+    title A8
+    last F2.0.
+
+list.
+])
+
+AT_CHECK([pspp -O format=csv x.sps], [0], [dnl
+Table: Data List
+foo,title,last
+1,this   ,1
+2,that   ,2
+3,other  ,3
+])
+
+AT_CLEANUP
+
+
+
+AT_SETUP([GET DATA /TYPE=txt another bug])
+
+AT_DATA([crash.sps], [dnl
+get data /type=txt /file=inline /variables=C f7.2 D f7>2.
+begin data.
+3 2
+4 2
+5 2
+end data.
+])
+
+AT_CHECK([pspp -O format=csv crash.sps], [1], [ignore])
+
+AT_CLEANUP
+
+
+
+
+
+