Automatically infer variables' measurement level from format and data.
[pspp] / tests / language / stats / autorecode.at
index 2267a80a90497be84540f66dd0314b9d627d178f..f639b078a493dfc2f895e2ee155c7c5ef582b17e 100644 (file)
@@ -1,16 +1,16 @@
 dnl PSPP - a program for statistical analysis.
 dnl Copyright (C) 2017 Free Software Foundation, Inc.
-dnl 
+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
 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
 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
@@ -142,8 +142,8 @@ list.
 AT_CHECK([pspp -O format=csv autorecode.sps], [0],
   [Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-X,1,1-  5,A5
-Y,1,7-  7,F1.0
+X,1,1-5,A5
+Y,1,7-7,F1.0
 
 Table: Recoding X into A.
 Old Value,New Value,Value Label
@@ -227,8 +227,8 @@ thingummies,6,3
 oojimiflips,7,2
 
 Table: Variables
-Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
-new,3,tracking my stuff,Scale,Input,8,Right,F1.0,F1.0,
+Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
+new,3,tracking my stuff,Nominal,Input,8,Right,F1.0,F1.0
 
 Table: Value Labels
 Variable Value,,Label
@@ -246,7 +246,7 @@ AT_DATA([ar-group.sps],
 [data list notable list /x y (f8.0).
 begin data.
 11 10
-12 12 
+12 12
 13 15
 14 11
 15 12
@@ -255,7 +255,7 @@ end data.
 
 missing values y (12).
 
-autorecode 
+autorecode
        x y into a b
        /group
        /print.
@@ -349,11 +349,11 @@ AT_DATA([ar-strings.sps],
 begin data.
 one    nine
 two    ten
-three  eleven 
+three  eleven
 four   nought
 end data.
 
-autorecode a b into x y 
+autorecode a b into x y
        /group
        /print.
 
@@ -454,8 +454,8 @@ list.
 AT_CHECK([pspp -O format=csv autorecode.sps], [0], [dnl
 Table: Reading 1 record from INLINE.
 Variable,Record,Columns,Format
-X,1,1-  5,A5
-Y,1,7-  7,F1.0
+X,1,1-5,A5
+Y,1,7-7,F1.0
 
 Table: Recoding X into A.
 Old Value,New Value,Value Label
@@ -522,3 +522,24 @@ x,y
 8,4
 ])
 AT_CLEANUP
+
+
+AT_SETUP([AUTORECODE with /BLANK without specifier])
+
+AT_DATA([autorecode.sps], [data list notable list /x (a18).
+begin data
+one
+two
+three
+end data.
+
+* /BLANK should be either =MISSING or =VALID
+autorecode x /into y
+ /blank
+
+execute.
+])
+
+AT_CHECK([pspp -O format=csv autorecode.sps], [1], [ignore])
+
+AT_CLEANUP