File: spreadsheet-test.at

package info (click to toggle)
pspp 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 69,768 kB
  • sloc: ansic: 276,489; xml: 18,462; sh: 6,445; python: 2,881; makefile: 125; perl: 64
file content (127 lines) | stat: -rw-r--r-- 3,221 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
dnl PSPP - a program for statistical analysis.
dnl Copyright (C) 2020, 2021 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([spreadsheet])

m4_define([SPREADSHEET_TEST],
  [AT_SETUP([$1 $2])
   AT_KEYWORDS([spreadsheet ods gnumeric $4])
   AT_CHECK([spreadsheet-test $2 $top_srcdir/tests/data/$1.gnumeric], [0], [$3], [ignore])
   AT_CHECK([spreadsheet-test $2 $top_srcdir/tests/data/$1.ods], [0], [$3], [ignore])
   AT_CLEANUP])

SPREADSHEET_TEST([simple], [--sheet=0], [dnl
Rows 4; Columns 3
one	two	three
four	five	six
seven	eight	nine
ten	eleven	twelve
])

SPREADSHEET_TEST([simple], [--sheet=0 --reverse], [dnl
Rows 4; Columns 3
twelve	eleven	ten
nine	eight	seven
six	five	four
three	two	one
])


SPREADSHEET_TEST([multisheet], [--sheet=1], [dnl
Rows 4; Columns 3
hi	tweedle	1
ho	dee	2
hum	dum	3
6	5	4
])


SPREADSHEET_TEST([repeating], [], [dnl
Rows 3; Columns 5
one	one	one	two	two
two	three	three	three	four
four	four	five	five	five
])

SPREADSHEET_TEST([sparse], [], [dnl
Rows 2; Columns 6
			0	1	2
the	row	above	starts	at	D
])

SPREADSHEET_TEST([holey], [], [dnl
Rows 1; Columns 8
		hi	ho			hum	hee
])

dnl If this test takes an unreasonably long time, then probably the caching
dnl code is not working.
dnl On my machine, this test takes about 7 seconds
SPREADSHEET_TEST([one-thousand-by-fifty-three], [--refcheck --reverse], [dnl
Rows 1000; Columns 53
], [slow])

dnl Check that the worksheet metadata is retrieved correctly
SPREADSHEET_TEST([multisheet], [--metadata], [dnl
Number of sheets: 3
])

SPREADSHEET_TEST([simple], [--metadata], [dnl
Number of sheets: 1
])



AT_SETUP([spreadsheet ODS with repeating data])
cp "$top_srcdir/tests/data/repeating-2.ods" .
AT_DATA([ods-import.sps], [dnl
get data /type=ods
   /file="repeating-2.ods"
   /sheet=index 1
   /cellrange=range "a1:j8"
   /readnames=on.

display variables.
list.
])

dnl Test for bug #61078
AT_CHECK([pspp -O format=csv ods-import.sps], [0], [dnl
Table: Variables
Name,Position,Print Format,Write Format
s2,1,F8.2,F8.2
s3,2,F8.2,F8.2
s4,3,F8.2,F8.2
s5,4,F8.2,F8.2
s6,5,F8.2,F8.2
s7,6,F8.2,F8.2
s6_A,7,F8.2,F8.2
s7_A,8,F8.2,F8.2
s8,9,F8.2,F8.2
s9,10,F8.2,F8.2

Table: Data List
s2,s3,s4,s5,s6,s7,s6_A,s7_A,s8,s9
31.00,5.00,1.00,1.00,4.00,5.00,4.00,5.00,5.00,4.00
38.00,1.00,.00,2.00,5.00,5.00,4.00,4.00,5.00,4.00
24.00,1.00,.00,3.00,5.00,5.00,4.00,4.00,5.00,3.00
49.00,5.00,2.00,3.00,4.00,5.00,4.00,5.00,5.00,5.00
30.00,1.00,.00,2.00,5.00,5.00,5.00,5.00,5.00,5.00
33.00,5.00,2.00,2.00,5.00,5.00,5.00,5.00,5.00,5.00
32.00,1.00,23.00,2.00,4.00,5.00,3.00,4.00,4.00,3.00
])

AT_CLEANUP