543dac1eb0d6ab819ab00759d3f0b222032d29d7
[pspp] / tests / output / pivot-table.at
1 AT_BANNER([pivot table rendering])
2
3 AT_SETUP([1-d pivot table])
4 AT_DATA([pivot.txt], [[
5 /col "a"*("a1", "a2", "a3")
6 /cell[all]
7 /title "Columns" /display
8 /title "Rows" /transpose.
9 ]])
10 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
11 Columns
12 ╭────────╮
13 │    a   │
14 ├──┬──┬──┤
15 │a1│a2│a3│
16 ├──┼──┼──┤
17 │ 0│ 1│ 2│
18 ╰──┴──┴──╯
19
20 Rows
21 ╭──┬─╮
22 │a │ │
23 ├──┼─┤
24 │a1│0│
25 │a2│1│
26 │a3│2│
27 ╰──┴─╯
28 ])
29 AT_CLEANUP
30
31 AT_SETUP([2-d pivot table])
32 AT_DATA([pivot.txt], [[
33 /col "a"("a1", "a2", "a3")
34 /col "b"("b1", "b2", "b3")
35 /cell[all, all]
36 /title "Columns" /display
37 /title "Rows" /transpose /display
38 /title "Column x Row" /move "a" column /display
39 /title "Row x Column" /transpose
40 ]])
41 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
42 Columns
43 ╭────────┬────────┬────────╮
44 │   b1   │   b2   │   b3   │
45 ├──┬──┬──┼──┬──┬──┼──┬──┬──┤
46 │a1│a2│a3│a1│a2│a3│a1│a2│a3│
47 ├──┼──┼──┼──┼──┼──┼──┼──┼──┤
48 │ 0│ 1│ 2│ 3│ 4│ 5│ 6│ 7│ 8│
49 ╰──┴──┴──┴──┴──┴──┴──┴──┴──╯
50
51 Rows
52 ╭─────┬─╮
53 │b1 a1│0│
54 │   a2│1│
55 │   a3│2│
56 ├─────┼─┤
57 │b2 a1│3│
58 │   a2│4│
59 │   a3│5│
60 ├─────┼─┤
61 │b3 a1│6│
62 │   a2│7│
63 │   a3│8│
64 ╰─────┴─╯
65
66 Column x Row
67 ╭──┬──┬──┬──╮
68 │  │a1│a2│a3│
69 ├──┼──┼──┼──┤
70 │b1│ 0│ 1│ 2│
71 │b2│ 3│ 4│ 5│
72 │b3│ 6│ 7│ 8│
73 ╰──┴──┴──┴──╯
74
75 Row x Column
76 ╭──┬──┬──┬──╮
77 │  │b1│b2│b3│
78 ├──┼──┼──┼──┤
79 │a1│ 0│ 3│ 6│
80 │a2│ 1│ 4│ 7│
81 │a3│ 2│ 5│ 8│
82 ╰──┴──┴──┴──╯
83 ])
84 AT_CLEANUP
85
86 AT_SETUP([2-d pivot table - dimension labels])
87 AT_DATA([pivot.txt], [[
88 /col "a"*("a1", "a2", "a3")
89 /col "b"*("b1", "b2", "b3")
90 /cell[all, all]
91 /title "Columns" /display
92 /title "Rows - Corner" /transpose /display
93 /title "Rows - Nested" /look rowlabels=nested /display
94 /title "Column x Row - Corner" /move "a" column /look rowlabels=corner /display
95 /title "Column x Row - Nested" /look rowlabels=nested /display
96 /title "Row x Column - Corner" /transpose /look rowlabels=corner /display
97 /title "Row x Column - Nested" /look rowlabels=nested
98 ]])
99 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
100 Columns
101 ╭──────────────────────────╮
102 │             b            │
103 ├────────┬────────┬────────┤
104 │   b1   │   b2   │   b3   │
105 ├────────┼────────┼────────┤
106 │    a   │    a   │    a   │
107 ├──┬──┬──┼──┬──┬──┼──┬──┬──┤
108 │a1│a2│a3│a1│a2│a3│a1│a2│a3│
109 ├──┼──┼──┼──┼──┼──┼──┼──┼──┤
110 │ 0│ 1│ 2│ 3│ 4│ 5│ 6│ 7│ 8│
111 ╰──┴──┴──┴──┴──┴──┴──┴──┴──╯
112
113 Rows - Corner
114 ╭─────┬─╮
115 │b  a │ │
116 ├─────┼─┤
117 │b1 a1│0│
118 │   a2│1│
119 │   a3│2│
120 ├─────┼─┤
121 │b2 a1│3│
122 │   a2│4│
123 │   a3│5│
124 ├─────┼─┤
125 │b3 a1│6│
126 │   a2│7│
127 │   a3│8│
128 ╰─────┴─╯
129
130 Rows - Nested
131 ╭─────────┬─╮
132 │b b1 a a1│0│
133 │       a2│1│
134 │       a3│2│
135 │ ╶───────┼─┤
136 │  b2 a a1│3│
137 │       a2│4│
138 │       a3│5│
139 │ ╶───────┼─┤
140 │  b3 a a1│6│
141 │       a2│7│
142 │       a3│8│
143 ╰─────────┴─╯
144
145 Column x Row - Corner
146 ╭──┬────────╮
147 │  │    a   │
148 │  ├──┬──┬──┤
149 │b │a1│a2│a3│
150 ├──┼──┼──┼──┤
151 │b1│ 0│ 1│ 2│
152 │b2│ 3│ 4│ 5│
153 │b3│ 6│ 7│ 8│
154 ╰──┴──┴──┴──╯
155
156 Column x Row - Nested
157 ╭────┬────────╮
158 │    │    a   │
159 │    ├──┬──┬──┤
160 │    │a1│a2│a3│
161 ├────┼──┼──┼──┤
162 │b b1│ 0│ 1│ 2│
163 │  b2│ 3│ 4│ 5│
164 │  b3│ 6│ 7│ 8│
165 ╰────┴──┴──┴──╯
166
167 Row x Column - Corner
168 ╭──┬────────╮
169 │  │    b   │
170 │  ├──┬──┬──┤
171 │a │b1│b2│b3│
172 ├──┼──┼──┼──┤
173 │a1│ 0│ 3│ 6│
174 │a2│ 1│ 4│ 7│
175 │a3│ 2│ 5│ 8│
176 ╰──┴──┴──┴──╯
177
178 Row x Column - Nested
179 ╭────┬────────╮
180 │    │    b   │
181 │    ├──┬──┬──┤
182 │    │b1│b2│b3│
183 ├────┼──┼──┼──┤
184 │a a1│ 0│ 3│ 6│
185 │  a2│ 1│ 4│ 7│
186 │  a3│ 2│ 5│ 8│
187 ╰────┴──┴──┴──╯
188 ])
189 AT_CLEANUP
190
191 AT_SETUP([2-d pivot table - groups])
192 AT_DATA([pivot.txt], [[
193 /col "a"("a1", "ag1"("a2", "a3"))
194 /col "b"("bg1"("b1", "b2"), "b3")
195 /cell[all, all]
196 /title "Columns" /display
197 /title "Rows" /transpose /display
198 /title "Column x Row" /move "a" column /display
199 /title "Row x Column" /transpose /display
200 /title "Row x Column - delete b2" /cells[all,1]=delete /display
201 /title "Row x Column - delete b2 - show empty" /look empty=show /display
202 /title "Row x Column - delete b1" /cells[all,0]=delete /look empty=hide /display
203 /title "Row x Column - delete b1 - show empty" /look empty=show.
204 ]])
205 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
206 Columns
207 ╭─────────────────┬────────╮
208 │       bg1       │        │
209 ├────────┬────────┤        │
210 │   b1   │   b2   │   b3   │
211 ├──┬─────┼──┬─────┼──┬─────┤
212 │  │ ag1 │  │ ag1 │  │ ag1 │
213 │  ├──┬──┤  ├──┬──┤  ├──┬──┤
214 │a1│a2│a3│a1│a2│a3│a1│a2│a3│
215 ├──┼──┼──┼──┼──┼──┼──┼──┼──┤
216 │ 0│ 1│ 2│ 3│ 4│ 5│ 6│ 7│ 8│
217 ╰──┴──┴──┴──┴──┴──┴──┴──┴──╯
218
219 Rows
220 ╭─────────────┬─╮
221 │bg1 b1 a1    │0│
222 │      ╶──────┼─┤
223 │       ag1 a2│1│
224 │           a3│2│
225 │   ╶─────────┼─┤
226 │    b2 a1    │3│
227 │      ╶──────┼─┤
228 │       ag1 a2│4│
229 │           a3│5│
230 ├─────────────┼─┤
231 │b3     a1    │6│
232 │      ╶──────┼─┤
233 │       ag1 a2│7│
234 │           a3│8│
235 ╰─────────────┴─╯
236
237 Column x Row
238 ╭──────┬──┬─────╮
239 │      │  │ ag1 │
240 │      │  ├──┬──┤
241 │      │a1│a2│a3│
242 ├──────┼──┼──┼──┤
243 │bg1 b1│ 0│ 1│ 2│
244 │    b2│ 3│ 4│ 5│
245 ├──────┼──┼──┼──┤
246 │b3    │ 6│ 7│ 8│
247 ╰──────┴──┴──┴──╯
248
249 Row x Column
250 ╭──────┬─────┬──╮
251 │      │ bg1 │  │
252 │      ├──┬──┤  │
253 │      │b1│b2│b3│
254 ├──────┼──┼──┼──┤
255 │a1    │ 0│ 3│ 6│
256 ├──────┼──┼──┼──┤
257 │ag1 a2│ 1│ 4│ 7│
258 │    a3│ 2│ 5│ 8│
259 ╰──────┴──┴──┴──╯
260
261 Row x Column - delete b2
262 ╭──────┬───┬──╮
263 │      │bg1│  │
264 │      ├───┤  │
265 │      │ b1│b3│
266 ├──────┼───┼──┤
267 │a1    │  0│ 6│
268 ├──────┼───┼──┤
269 │ag1 a2│  1│ 7│
270 │    a3│  2│ 8│
271 ╰──────┴───┴──╯
272
273 Row x Column - delete b2 - show empty
274 ╭──────┬─────┬──╮
275 │      │ bg1 │  │
276 │      ├──┬──┤  │
277 │      │b1│b2│b3│
278 ├──────┼──┼──┼──┤
279 │a1    │ 0│  │ 6│
280 ├──────┼──┼──┼──┤
281 │ag1 a2│ 1│  │ 7│
282 │    a3│ 2│  │ 8│
283 ╰──────┴──┴──┴──╯
284
285 Row x Column - delete b1
286 ╭──────┬──╮
287 │      │b3│
288 ├──────┼──┤
289 │a1    │ 6│
290 ├──────┼──┤
291 │ag1 a2│ 7│
292 │    a3│ 8│
293 ╰──────┴──╯
294
295 Row x Column - delete b1 - show empty
296 ╭──────┬─────┬──╮
297 │      │ bg1 │  │
298 │      ├──┬──┤  │
299 │      │b1│b2│b3│
300 ├──────┼──┼──┼──┤
301 │a1    │  │  │ 6│
302 ├──────┼──┼──┼──┤
303 │ag1 a2│  │  │ 7│
304 │    a3│  │  │ 8│
305 ╰──────┴──┴──┴──╯
306 ])
307 AT_CLEANUP
308
309 AT_SETUP([2-d pivot table - layers])
310 AT_DATA([pivot.txt], [[
311 /col "a"("a1", "a2", "a3")
312 /layer "b"("b1", "b2", "b3")
313 /cell[all, all]
314 /title "Column x b1" /display
315 /title "Row x b1" /transpose /display
316 /title "Column x b2" /show layer 1 /transpose /display
317 /title "Row x b2" /transpose /display
318 /title "Column (All Layers)" /look layers=all /display
319 /title "Row (All Layers)" /transpose /look layers=all
320 ]])
321 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
322 Column x b1
323 b1
324 ╭──┬──┬──╮
325 │a1│a2│a3│
326 ├──┼──┼──┤
327 │ 0│ 1│ 2│
328 ╰──┴──┴──╯
329
330 Row x b1
331 b1
332 ╭──┬─╮
333 │a1│0│
334 │a2│1│
335 │a3│2│
336 ╰──┴─╯
337
338 Column x b2
339 b2
340 ╭──┬──┬──╮
341 │a1│a2│a3│
342 ├──┼──┼──┤
343 │ 3│ 4│ 5│
344 ╰──┴──┴──╯
345
346 Row x b2
347 b2
348 ╭──┬─╮
349 │a1│3│
350 │a2│4│
351 │a3│5│
352 ╰──┴─╯
353
354 Column (All Layers)
355 b1
356 ╭──┬─╮
357 │a1│0│
358 │a2│1│
359 │a3│2│
360 ╰──┴─╯
361
362 Column (All Layers)
363 b2
364 ╭──┬─╮
365 │a1│3│
366 │a2│4│
367 │a3│5│
368 ╰──┴─╯
369
370 Column (All Layers)
371 b3
372 ╭──┬─╮
373 │a1│6│
374 │a2│7│
375 │a3│8│
376 ╰──┴─╯
377
378 Row (All Layers)
379 b1
380 ╭──┬──┬──╮
381 │a1│a2│a3│
382 ├──┼──┼──┤
383 │ 0│ 1│ 2│
384 ╰──┴──┴──╯
385
386 Row (All Layers)
387 b2
388 ╭──┬──┬──╮
389 │a1│a2│a3│
390 ├──┼──┼──┤
391 │ 3│ 4│ 5│
392 ╰──┴──┴──╯
393
394 Row (All Layers)
395 b3
396 ╭──┬──┬──╮
397 │a1│a2│a3│
398 ├──┼──┼──┤
399 │ 6│ 7│ 8│
400 ╰──┴──┴──╯
401 ])
402 AT_CLEANUP
403
404 AT_SETUP([3-d pivot table - layers])
405 AT_DATA([pivot.txt], [[
406 /layer "a"("a1", "a2", "a3")
407 /layer "b"("b1", "b2", "b3", "b4")
408 /col "c"("c1", "c2", "c3", "c4", "c5")
409 /cell[all, all, all]
410 /title "Column x b1 x a1" /display
411 /title "Column x b2 x a1" /show layer 0 1 /display
412 /title "Column x b3 x a2" /show layer 1 2 /display
413 ]])
414 AT_DATA([expout], [dnl
415 Column x b1 x a1
416 b1
417 a1
418 ╭──┬──┬──┬──┬──╮
419 │c1│c2│c3│c4│c5│
420 ├──┼──┼──┼──┼──┤
421 │ 0│12│24│36│48│
422 ╰──┴──┴──┴──┴──╯
423
424 Column x b2 x a1
425 b2
426 a1
427 ╭──┬──┬──┬──┬──╮
428 │c1│c2│c3│c4│c5│
429 ├──┼──┼──┼──┼──┤
430 │ 3│15│27│39│51│
431 ╰──┴──┴──┴──┴──╯
432
433 Column x b3 x a2
434 b3
435 a2
436 ╭──┬──┬──┬──┬──╮
437 │c1│c2│c3│c4│c5│
438 ├──┼──┼──┼──┼──┤
439 │ 7│19│31│43│55│
440 ╰──┴──┴──┴──┴──╯
441 ])
442 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [expout])
443 AT_CLEANUP
444
445 AT_SETUP([pivot table title and caption])
446 AT_DATA([pivot.txt], [[
447 /col "a"("a1", "a2")
448 /row "b"("b1", "b2")
449 /cell[all, all]
450 /title "Title + Caption" /caption "Title + Caption" /display
451 /title "Title Only" /caption "(Not Shown)" /show title=yes caption=no /display
452 /title "(Not Shown)" /caption "Caption Only" /show title=no caption=yes /display
453 /title "(Not Shown)" /caption "(Not Shown)" /show title=no caption=no
454 ]])
455 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
456 Title + Caption
457 ╭──┬──┬──╮
458 │  │a1│a2│
459 ├──┼──┼──┤
460 │b1│ 0│ 1│
461 │b2│ 2│ 3│
462 ╰──┴──┴──╯
463 Title + Caption
464
465 Title Only
466 ╭──┬──┬──╮
467 │  │a1│a2│
468 ├──┼──┼──┤
469 │b1│ 0│ 1│
470 │b2│ 2│ 3│
471 ╰──┴──┴──╯
472
473 ╭──┬──┬──╮
474 │  │a1│a2│
475 ├──┼──┼──┤
476 │b1│ 0│ 1│
477 │b2│ 2│ 3│
478 ╰──┴──┴──╯
479 Caption Only
480
481 ╭──┬──┬──╮
482 │  │a1│a2│
483 ├──┼──┼──┤
484 │b1│ 0│ 1│
485 │b2│ 2│ 3│
486 ╰──┴──┴──╯
487 ])
488 AT_CLEANUP
489
490 AT_SETUP([pivot table footnotes])
491 AT_KEYWORDS([footnote])
492 AT_DATA([pivot.txt], [[
493 /footnote[0] "First footnote" marker="*"
494 /footnote[1] "Second footnote"
495 /col "A"[footnote 0]*("B"[footnote 1], "C"[footnote 0 1])
496 /row "D"[footnote 1]*("E"[footnote 0], "F"[footnote 1 0])
497 /look rowlabels=nested
498 /cell[0, 0]=0
499 /cell[1, 0]=1[footnote 0]
500 /cell[0, 1]=2[footnote 1]
501 /cell[1, 1]=3[footnote 0 1]
502 /caption "Caption"[footnote 0]
503 /corner "Corner"[footnote 0 1]
504 /title "Pivot Table with Alphabetic Subscript Footnotes"[footnote 0]
505 /look marker=alpha level=sub
506 /display
507 /title "Pivot Table with Alphabetic Superscript Footnotes"[footnote 0]
508 /look marker=alpha level=super
509 /display
510 /title "Pivot Table with Numeric Subscript Footnotes"[footnote 0]
511 /look marker=numeric level=sub
512 /display
513 /title "Pivot Table with Numeric Superscript Footnotes"[footnote 0]
514 /look marker=numeric level=super
515 /display
516 /title "Hidden Footnote"[footnote 0]
517 /footnote[0] "First footnote" marker="*" hide
518 ]])
519 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0],
520 [[Pivot Table with Alphabetic Subscript Footnotes[*]
521 ╭────────────┬──────────────────╮
522 │            │       A[*]       │
523 │            ├───────┬──────────┤
524 │Corner[*][b]│  B[b] │  C[*][b] │
525 ├────────────┼───────┼──────────┤
526 │D[b] E[*]   │    .00│   1.00[*]│
527 │     F[*][b]│2.00[b]│3.00[*][b]│
528 ╰────────────┴───────┴──────────╯
529 Caption[*]
530 *. First footnote
531 b. Second footnote
532
533 Pivot Table with Alphabetic Superscript Footnotes[*]
534 ╭────────────┬──────────────────╮
535 │            │       A[*]       │
536 │            ├───────┬──────────┤
537 │Corner[*][b]│  B[b] │  C[*][b] │
538 ├────────────┼───────┼──────────┤
539 │D[b] E[*]   │    .00│   1.00[*]│
540 │     F[*][b]│2.00[b]│3.00[*][b]│
541 ╰────────────┴───────┴──────────╯
542 Caption[*]
543 *. First footnote
544 b. Second footnote
545
546 Pivot Table with Numeric Subscript Footnotes[*]
547 ╭────────────┬──────────────────╮
548 │            │       A[*]       │
549 │            ├───────┬──────────┤
550 │Corner[*][2]│  B[2] │  C[*][2] │
551 ├────────────┼───────┼──────────┤
552 │D[2] E[*]   │    .00│   1.00[*]│
553 │     F[*][2]│2.00[2]│3.00[*][2]│
554 ╰────────────┴───────┴──────────╯
555 Caption[*]
556 *. First footnote
557 2. Second footnote
558
559 Pivot Table with Numeric Superscript Footnotes[*]
560 ╭────────────┬──────────────────╮
561 │            │       A[*]       │
562 │            ├───────┬──────────┤
563 │Corner[*][2]│  B[2] │  C[*][2] │
564 ├────────────┼───────┼──────────┤
565 │D[2] E[*]   │    .00│   1.00[*]│
566 │     F[*][2]│2.00[2]│3.00[*][2]│
567 ╰────────────┴───────┴──────────╯
568 Caption[*]
569 *. First footnote
570 2. Second footnote
571
572 Hidden Footnote[*]
573 ╭────────────┬──────────────────╮
574 │            │       A[*]       │
575 │            ├───────┬──────────┤
576 │Corner[*][2]│  B[2] │  C[*][2] │
577 ├────────────┼───────┼──────────┤
578 │D[2] E[*]   │    .00│   1.00[*]│
579 │     F[*][2]│2.00[2]│3.00[*][2]│
580 ╰────────────┴───────┴──────────╯
581 Caption[*]
582 2. Second footnote
583 ]])
584 AT_CLEANUP
585
586 AT_SETUP([pivot table with no dimensions])
587 AT_DATA([pivot.txt], [[
588 /title "No Dimensions"
589 ]])
590 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
591 No Dimensions
592 ╭╮
593 ╰╯
594 ])
595 AT_CLEANUP
596
597 AT_SETUP([pivot table with empty dimensions])
598 AT_DATA([pivot.txt], [[
599 /col "a"()
600 /look empty=show
601 /title "One Empty Dimension" /display
602 /title "Two Empty Dimensions" /row "b"*() /display
603 /title "Three Dimensions, Two Empty" /row "c"("c1", "c2")
604 ]])
605 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
606 One Empty Dimension
607
608 Two Empty Dimensions
609
610 Three Dimensions, Two Empty
611 ])
612 AT_CLEANUP
613
614 AT_SETUP([pivot table with empty groups])
615 AT_DATA([pivot.txt], [[
616 /col "a"("a1", "a2"(), "a3")
617 /row "b"("b1"(), "b2", "b3")
618 /cell[all,all]
619 /look empty=show
620 /display
621 ]])
622 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
623 Default Title
624 ╭──┬──┬──╮
625 │  │a1│a3│
626 ├──┼──┼──┤
627 │b2│ 0│ 1│
628 │b3│ 2│ 3│
629 ╰──┴──┴──╯
630 ])
631 AT_CLEANUP
632
633 AT_SETUP([pivot table - category and dimension borders])
634 AT_DATA([pivot.txt], [[
635 /col "a"("a1", "ag1"("a2", "a3"))
636 /col "b"("bg1"("b1", "b2"), "b3")
637 /row "c"("c1", "cg1"("c2", "c3"))
638 /row "d"("dg1"("d1", "d2"), "d3")
639 /cell[all, all, all, all]
640 /border "*" (none)
641 /border "dim-row-horz" (solid "blue")
642         "cat-row-horz" (dashed "red")
643         "dim-row-vert" (solid "blue")
644         "cat-row-vert" (dashed "red")
645         "dim-col-horz" (solid "blue")
646         "cat-col-horz" (dashed "red")
647         "dim-col-vert" (solid "blue")
648         "cat-col-vert" (dashed "red")
649 /title "Category and Dimension Borders"
650 ]])
651 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
652 Category and Dimension Borders
653                      bg1       │
654              ╶╌╌╌╌╌╌╌╌┬╌╌╌╌╌╌╌╌┤
655                  b1   │   b2   │   b3
656              ╶──┬─────┼──┬─────┼──┬─────
657                 │ ag1 │  │ ag1 │  │ ag1
658                 ├╌╌┬╌╌┤  ├╌╌┬╌╌┤  ├╌╌┬╌╌
659               a1│a2┊a3│a1│a2┊a3│a1│a2┊a3
660 dg1┊d1│c1      0│ 1┊ 2│ 3│ 4┊ 5│ 6│ 7┊ 8
661    ┊  ├───┬─────┼──┼──┼──┼──┼──┼──┼──┼──
662    ┊  │cg1┊c2  9│10┊11│12│13┊14│15│16┊17
663    ┊  │   ├╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
664    ┊  │   ┊c3 18│19┊20│21│22┊23│24│25┊26
665    ├──┼───┴─────┼──┼──┼──┼──┼──┼──┼──┼──
666    ┊d2│c1     27│28┊29│30│31┊32│33│34┊35
667    ┊  ├───┬─────┼──┼──┼──┼──┼──┼──┼──┼──
668    ┊  │cg1┊c2 36│37┊38│39│40┊41│42│43┊44
669    ┊  │   ├╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
670    ┊  │   ┊c3 45│46┊47│48│49┊50│51│52┊53
671 ───┴──┼───┴─────┼──┼──┼──┼──┼──┼──┼──┼──
672 d3    │c1     54│55┊56│57│58┊59│60│61┊62
673       ├───┬─────┼──┼──┼──┼──┼──┼──┼──┼──
674       │cg1┊c2 63│64┊65│66│67┊68│69│70┊71
675       │   ├╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
676       │   ┊c3 72│73┊74│75│76┊77│78│79┊80
677 ])
678 AT_CLEANUP
679
680 AT_SETUP([pivot table - small numbers])
681 AT_DATA([pivot.txt], [[
682 /title "small numbers"
683 /row "exponent"*("0", "-1", "-2", "-3", "-4", "-5", "-6", "-7", "-8", "-9")
684 /col "sign"*("positive", "negative")
685 /col "result class"*("general" RC_OTHER, "specific" RC_RESIDUAL)
686 /cell[0, 0, 0] = 1
687 /cell[1, 0, 0] = .1
688 /cell[2, 0, 0] = .01
689 /cell[3, 0, 0] = .001
690 /cell[4, 0, 0] = .0001
691 /cell[5, 0, 0] = .00001
692 /cell[6, 0, 0] = .000001
693 /cell[7, 0, 0] = .0000001
694 /cell[8, 0, 0] = .00000001
695 /cell[9, 0, 0] = .000000001
696 /cell[0, 0, 1] = -1
697 /cell[1, 0, 1] = -.1
698 /cell[2, 0, 1] = -.01
699 /cell[3, 0, 1] = -.001
700 /cell[4, 0, 1] = -.0001
701 /cell[5, 0, 1] = -.00001
702 /cell[6, 0, 1] = -.000001
703 /cell[7, 0, 1] = -.0000001
704 /cell[8, 0, 1] = -.00000001
705 /cell[9, 0, 1] = -.000000001
706 /cell[0, 1, 0] = 1
707 /cell[1, 1, 0] = .1
708 /cell[2, 1, 0] = .01
709 /cell[3, 1, 0] = .001
710 /cell[4, 1, 0] = .0001
711 /cell[5, 1, 0] = .00001
712 /cell[6, 1, 0] = .000001
713 /cell[7, 1, 0] = .0000001
714 /cell[8, 1, 0] = .00000001
715 /cell[9, 1, 0] = .000000001
716 /cell[0, 1, 1] = -1
717 /cell[1, 1, 1] = -.1
718 /cell[2, 1, 1] = -.01
719 /cell[3, 1, 1] = -.001
720 /cell[4, 1, 1] = -.0001
721 /cell[5, 1, 1] = -.00001
722 /cell[6, 1, 1] = -.000001
723 /cell[7, 1, 1] = -.0000001
724 /cell[8, 1, 1] = -.00000001
725 /cell[9, 1, 1] = -.000000001
726 ]])
727 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [dnl
728 small numbers
729 ╭────────┬─────────────────────────────────────╮
730 │        │             result class            │
731 │        ├───────────────────┬─────────────────┤
732 │        │      general      │     specific    │
733 │        ├───────────────────┼─────────────────┤
734 │        │        sign       │       sign      │
735 │        ├─────────┬─────────┼────────┬────────┤
736 │exponent│ positive│ negative│positive│negative│
737 ├────────┼─────────┼─────────┼────────┼────────┤
738 │0       │     1.00│     1.00│   -1.00│   -1.00│
739 │-1      │      .10│      .10│    -.10│    -.10│
740 │-2      │      .01│      .01│    -.01│    -.01│
741 │-3      │      .00│      .00│     .00│     .00│
742 │-4      │      .00│      .00│     .00│     .00│
743 │-5      │1.00E-005│1.00E-005│     .00│     .00│
744 │-6      │1.00E-006│1.00E-006│     .00│     .00│
745 │-7      │1.00E-007│1.00E-007│     .00│     .00│
746 │-8      │1.00E-008│1.00E-008│     .00│     .00│
747 │-9      │1.00E-009│1.00E-009│     .00│     .00│
748 ╰────────┴─────────┴─────────┴────────┴────────╯
749 ])
750 AT_CLEANUP