f3367f1b2e50883da524a4eccb494bc8ed12f71e
[pspp] / tests / language / data-io / print-space.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl 
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl 
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl 
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl
17 AT_BANNER([PRINT SPACE])
18
19 AT_SETUP([PRINT SPACE without arguments])
20 AT_DATA([print-space.sps], [dnl
21 DATA LIST NOTABLE/x 1.
22 BEGIN DATA.
23 1
24 2
25 END DATA.
26 PRINT/x.
27 PRINT SPACE.
28 EXECUTE.
29 ])
30 AT_CHECK([pspp -O format=csv print-space.sps], [0], [dnl
31 1 @&t@
32
33
34
35 2 @&t@
36
37
38 ])
39 AT_CLEANUP
40
41 AT_SETUP([PRINT SPACE with number])
42 AT_DATA([print-space.sps], [dnl
43 DATA LIST NOTABLE/x 1.
44 BEGIN DATA.
45 1
46 2
47 END DATA.
48 PRINT/x.
49 PRINT SPACE 2.
50 EXECUTE.
51 ])
52 AT_CHECK([pspp -O format=csv print-space.sps], [0], [dnl
53 1 @&t@
54
55
56
57
58
59 2 @&t@
60
61
62
63
64 ])
65 AT_CLEANUP
66
67 AT_SETUP([PRINT SPACE to file])
68 AT_CAPTURE_FILE([output.txt])
69 AT_DATA([print-space.sps], [dnl
70 DATA LIST NOTABLE/x 1.
71 BEGIN DATA.
72 1
73 2
74 END DATA.
75 PRINT OUTFILE='output.txt'/x.
76 PRINT SPACE OUTFILE='output.txt'.
77 EXECUTE.
78 ])
79 AT_CHECK([pspp -O format=csv print-space.sps])
80 AT_CHECK([cat output.txt], [0], [dnl
81  1 @&t@
82  @&t@
83  2 @&t@
84  @&t@
85 ])
86 AT_CLEANUP
87
88 AT_SETUP([PRINT SPACE to file with number])
89 AT_CAPTURE_FILE([output.txt])
90 AT_DATA([print-space.sps], [dnl
91 DATA LIST NOTABLE/x 1.
92 BEGIN DATA.
93 1
94 2
95 END DATA.
96 PRINT OUTFILE='output.txt'/x.
97 PRINT SPACE OUTFILE='output.txt' 2.
98 EXECUTE.
99 ])
100 AT_CHECK([pspp -O format=csv print-space.sps])
101 AT_CHECK([cat output.txt], [0], [dnl
102  1 @&t@
103  @&t@
104  @&t@
105  2 @&t@
106  @&t@
107  @&t@
108 ])
109 AT_CLEANUP