pivot-table: Add test for footnotes.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 10 Jan 2021 02:01:52 +0000 (18:01 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 10 Jan 2021 02:03:09 +0000 (18:03 -0800)
tests/output/pivot-table.at

index 19b1930ccc013dbfafe8e2f6c92d701b17dc8104..7f09330a15a80500e4e7e28fef2d256c9c3f466c 100644 (file)
@@ -446,6 +446,87 @@ Caption Only
 ])
 AT_CLEANUP
 
+AT_SETUP([pivot table footnotes])
+AT_KEYWORDS([footnote])
+AT_DATA([pivot.txt], [[
+/footnote[0] "First footnote" marker="*"
+/footnote[1] "Second footnote"
+/col "A"[footnote 0]*("B"[footnote 1], "C"[footnote 0 1])
+/row "D"[footnote 1]*("E"[footnote 0], "F"[footnote 1 0])
+/look rowlabels=nested
+/cell[0, 0]=0
+/cell[1, 0]=1[footnote 0]
+/cell[0, 1]=2[footnote 1]
+/cell[1, 1]=3[footnote 0 1]
+/caption "Caption"[footnote 0]
+/corner "Corner"[footnote 0 1]
+/title "Pivot Table with Alphabetic Subscript Footnotes"[footnote 0]
+/look marker=alpha level=sub
+/display
+/title "Pivot Table with Alphabetic Superscript Footnotes"[footnote 0]
+/look marker=alpha level=super
+/display
+/title "Pivot Table with Numeric Subscript Footnotes"[footnote 0]
+/look marker=numeric level=sub
+/display
+/title "Pivot Table with Numeric Superscript Footnotes"[footnote 0]
+/look marker=numeric level=super
+]])
+AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0],
+[[Pivot Table with Alphabetic Subscript Footnotes[*]
+╭────────────┬──────────────────╮
+│            │       A[*]       │
+│            ├───────┬──────────┤
+│Corner[*][b]│  B[b] │  C[*][b] │
+├────────────┼───────┼──────────┤
+│D[b] E[*]   │    .00│   1.00[*]│
+│     F[*][b]│2.00[b]│3.00[*][b]│
+╰────────────┴───────┴──────────╯
+Caption[*]
+*. First footnote
+b. Second footnote
+
+Pivot Table with Alphabetic Superscript Footnotes[*]
+╭────────────┬──────────────────╮
+│            │       A[*]       │
+│            ├───────┬──────────┤
+│Corner[*][b]│  B[b] │  C[*][b] │
+├────────────┼───────┼──────────┤
+│D[b] E[*]   │    .00│   1.00[*]│
+│     F[*][b]│2.00[b]│3.00[*][b]│
+╰────────────┴───────┴──────────╯
+Caption[*]
+*. First footnote
+b. Second footnote
+
+Pivot Table with Numeric Subscript Footnotes[*]
+╭────────────┬──────────────────╮
+│            │       A[*]       │
+│            ├───────┬──────────┤
+│Corner[*][2]│  B[2] │  C[*][2] │
+├────────────┼───────┼──────────┤
+│D[2] E[*]   │    .00│   1.00[*]│
+│     F[*][2]│2.00[2]│3.00[*][2]│
+╰────────────┴───────┴──────────╯
+Caption[*]
+*. First footnote
+2. Second footnote
+
+Pivot Table with Numeric Superscript Footnotes[*]
+╭────────────┬──────────────────╮
+│            │       A[*]       │
+│            ├───────┬──────────┤
+│Corner[*][2]│  B[2] │  C[*][2] │
+├────────────┼───────┼──────────┤
+│D[2] E[*]   │    .00│   1.00[*]│
+│     F[*][2]│2.00[2]│3.00[*][2]│
+╰────────────┴───────┴──────────╯
+Caption[*]
+*. First footnote
+2. Second footnote
+]])
+AT_CLEANUP
+
 AT_SETUP([pivot table with no dimensions])
 AT_DATA([pivot.txt], [[
 /title "No Dimensions"