Skip to content

Commit adffe22

Browse files
committed
🚨 Fix tests
1 parent 0593ff9 commit adffe22

File tree

4 files changed

+124
-103
lines changed

4 files changed

+124
-103
lines changed

test/backends/html/full.jl

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,32 @@
55
############################################################################################
66

77
@testset "All Available Fields" verbose = true begin
8-
matrix = [(i, j) for i in 1:3, j in 1:3]
8+
matrix = [(i, j) for i in 1:4, j in 1:4]
99

1010
@testset "Without Cropping" begin
1111
expected = """
1212
<table>
1313
<thead>
1414
<tr class = "title">
15-
<td colspan = "5" style = "text-align: center; font-size: x-large; font-weight: bold;">Table Title</td>
15+
<td colspan = "6" style = "text-align: center; font-size: x-large; font-weight: bold;">Table Title</td>
1616
</tr>
1717
<tr class = "subtitle">
18-
<td colspan = "5" style = "text-align: center; font-size: large; font-style: italic;">Table Subtitle</td>
18+
<td colspan = "6" style = "text-align: center; font-size: large; font-style: italic;">Table Subtitle</td>
1919
</tr>
2020
<tr class = "columnLabelRow">
2121
<th class = "rowNumberLabel" style = "text-align: right; font-weight: bold;">Row</th>
2222
<th class = "stubheadLabel" style = "text-align: right; font-weight: bold;">Rows</th>
2323
<th style = "text-align: right; font-weight: bold;">Col. 1</th>
2424
<th colspan = "2" style = "border-bottom: 1px solid black; text-align: center; font-weight: bold;">Merged Column<sup>1</sup></th>
25+
<th style = "text-align: right; font-weight: bold;">Col. 4</th>
2526
</tr>
2627
<tr class = "columnLabelRow">
2728
<th class = "rowNumberLabel" style = "text-align: right; font-weight: bold;"></th>
2829
<th class = "stubheadLabel" style = "text-align: right; font-weight: bold;"></th>
2930
<th style = "text-align: right;">1</th>
3031
<th style = "text-align: right;">2</th>
3132
<th style = "text-align: right;">3</th>
33+
<th style = "text-align: right;">4</th>
3234
</tr>
3335
</thead>
3436
<tbody>
@@ -38,48 +40,61 @@
3840
<td style = "text-align: right;">(1, 1)</td>
3941
<td style = "text-align: right;">(1, 2)</td>
4042
<td style = "text-align: right;">(1, 3)</td>
43+
<td style = "text-align: right;">(1, 4)</td>
4144
</tr>
4245
<tr class = "rowGroupLabel">
43-
<td colspan = "5" style = "text-align: left; font-weight: bold;">Row Group</td>
46+
<td colspan = "6" style = "text-align: left; font-weight: bold;">Row Group</td>
4447
</tr>
4548
<tr class = "dataRow">
4649
<td class = "rowNumber" style = "text-align: right; font-weight: bold;">2</td>
4750
<td class = "rowLabel" style = "text-align: right; font-weight: bold;">Row 2</td>
4851
<td style = "text-align: right;">(2, 1)</td>
4952
<td style = "text-align: right;">(2, 2)<sup>2</sup></td>
5053
<td style = "text-align: right;">(2, 3)</td>
54+
<td style = "text-align: right;">(2, 4)</td>
5155
</tr>
5256
<tr class = "dataRow">
5357
<td class = "rowNumber" style = "text-align: right; font-weight: bold;">3</td>
5458
<td class = "rowLabel" style = "text-align: right; font-weight: bold;">Row 3</td>
5559
<td style = "text-align: right;">(3, 1)</td>
5660
<td style = "text-align: right;">(3, 2)</td>
5761
<td style = "text-align: right;">(3, 3)</td>
62+
<td style = "text-align: right;">(3, 4)</td>
63+
</tr>
64+
<tr class = "dataRow">
65+
<td class = "rowNumber" style = "text-align: right; font-weight: bold;">4</td>
66+
<td class = "rowLabel" style = "text-align: right; font-weight: bold;">Row 4</td>
67+
<td style = "text-align: right;">(4, 1)</td>
68+
<td style = "text-align: right;">(4, 2)</td>
69+
<td style = "text-align: right;">(4, 3)</td>
70+
<td style = "text-align: right;">(4, 4)</td>
5871
</tr>
5972
<tr class = "summaryRow">
6073
<td class = "summaryRowNumber" style = "text-align: right; font-weight: bold;"></td>
6174
<td class = "summaryRowLabel" style = "text-align: right; font-weight: bold;">Summary 1</td>
6275
<td style = "text-align: right;">10</td>
6376
<td style = "text-align: right;">20</td>
6477
<td style = "text-align: right;">30</td>
78+
<td style = "text-align: right;">40</td>
6579
</tr>
6680
<tr class = "summaryRow">
6781
<td class = "summaryRowNumber" style = "text-align: right; font-weight: bold;"></td>
6882
<td class = "summaryRowLabel" style = "text-align: right; font-weight: bold;">Summary 2</td>
6983
<td style = "text-align: right;">20</td>
7084
<td style = "text-align: right;">40</td>
7185
<td style = "text-align: right;">60</td>
86+
<td style = "text-align: right;">80</td>
7287
</tr>
7388
</tbody>
7489
<tfoot>
7590
<tr class = "footnote">
76-
<td colspan = "5" style = "text-align: left; font-size: small;"><sup>1</sup> Footnote in column label</td>
91+
<td colspan = "6" style = "text-align: left; font-size: small;"><sup>1</sup> Footnote in column label</td>
7792
</tr>
7893
<tr class = "footnote">
79-
<td colspan = "5" style = "text-align: left; font-size: small;"><sup>2</sup> Footnote in data</td>
94+
<td colspan = "6" style = "text-align: left; font-size: small;"><sup>2</sup> Footnote in data</td>
8095
</tr>
8196
<tr class = "sourceNotes">
82-
<td colspan = "5" style = "text-align: left; color: gray; font-size: small; font-style: italic;">Source Notes</td>
97+
<td colspan = "6" style = "text-align: left; color: gray; font-size: small; font-style: italic;">Source Notes</td>
8398
</tr>
8499
</tbody>
85100
</table>
@@ -89,7 +104,7 @@
89104
String,
90105
matrix;
91106
backend = :html,
92-
column_labels = [["Col. $i" for i in 1:3], ["$i" for i in 1:3]],
107+
column_labels = [["Col. $i" for i in 1:4], ["$i" for i in 1:4]],
93108
footnotes = [(:column_label, 1, 2) => "Footnote in column label", (:data, 2, 2) => "Footnote in data"],
94109
merge_column_label_cells = [MergeCells(1, 2, 2, "Merged Column", :c)],
95110
row_group_labels = [2 => "Row Group"],
@@ -109,7 +124,7 @@
109124
expected = """
110125
<div>
111126
<div style = "font-style: italic; float: right;">
112-
<span>1 column and 1 row omitted</span>
127+
<span>2 columns and 2 rows omitted</span>
113128
</div>
114129
<div style = "clear: both;"></div>
115130
</div>
@@ -208,7 +223,7 @@
208223
expected = """
209224
<div>
210225
<div style = "font-style: italic; float: right;">
211-
<span>1 column and 1 row omitted</span>
226+
<span>2 columns and 2 rows omitted</span>
212227
</div>
213228
<div style = "clear: both;"></div>
214229
</div>
@@ -244,10 +259,10 @@
244259
<td style = "text-align: right;">&dtdot;</td>
245260
</tr>
246261
<tr class = "dataRow">
247-
<td class = "rowNumber" style = "text-align: right; font-weight: bold;">3</td>
248-
<td class = "rowLabel" style = "text-align: right; font-weight: bold;">Row 3</td>
249-
<td style = "text-align: right;">(3, 1)</td>
250-
<td style = "text-align: right;">(3, 2)</td>
262+
<td class = "rowNumber" style = "text-align: right; font-weight: bold;">4</td>
263+
<td class = "rowLabel" style = "text-align: right; font-weight: bold;">Row 4</td>
264+
<td style = "text-align: right;">(4, 1)</td>
265+
<td style = "text-align: right;">(4, 2)</td>
251266
<td>&ctdot;</td>
252267
</tr>
253268
<tr class = "summaryRow">

test/backends/markdown/compact.jl

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,24 @@
55
############################################################################################
66

77
@testset "Compact Table" verbose = true begin
8-
matrix = [(i, j) for i in 1:3, j in 1:3]
8+
matrix = [(i, j) for i in 1:4, j in 1:4]
99

1010
@testset "Without Cropping" begin
1111
expected = """
1212
# Table Title
1313
1414
## Table Subtitle
1515
16-
| **Row** | **Rows** | **Col. 1**<br>`1` | **Merged Column[^1]**<br>`2` | ─ |
17-
|--:|--:|--:|--:|--:|
18-
| 1 | **Row 1** | (1, 1) | (1, 2) | (1, 3) |
19-
| **Row Group** | ─ | ─ | ─ | ─ |
20-
| 2 | **Row 2** | (2, 1) | (2, 2)[^2] | (2, 3) |
21-
| 3 | **Row 3** | (3, 1) | (3, 2) | (3, 3) |
22-
| ─ | ─ | ─ | ─ | ─ |
23-
| | **Summary 1** | 10 | 20 | 30 |
24-
| | **Summary 2** | 20 | 40 | 60 |
16+
| **Row** | **Rows** | **Col. 1**<br>`1` | **Merged Column[^1]**<br>`2` | ─ | **Col. 4**<br>`4` |
17+
|--:|--:|--:|--:|--:|--:|
18+
| 1 | **Row 1** | (1, 1) | (1, 2) | (1, 3) | (1, 4) |
19+
| **Row Group** | ─ | ─ | ─ | ─ | ─ |
20+
| 2 | **Row 2** | (2, 1) | (2, 2)[^2] | (2, 3) | (2, 4) |
21+
| 3 | **Row 3** | (3, 1) | (3, 2) | (3, 3) | (3, 4) |
22+
| 4 | **Row 4** | (4, 1) | (4, 2) | (4, 3) | (4, 4) |
23+
| ─ | ─ | ─ | ─ | ─ | ─ |
24+
| | **Summary 1** | 10 | 20 | 30 | 40 |
25+
| | **Summary 2** | 20 | 40 | 60 | 80 |
2526
2627
[^1]: Footnote in column label
2728
[^2]: Footnote in data
@@ -33,7 +34,7 @@ Source Notes
3334
String,
3435
matrix;
3536
backend = :markdown,
36-
column_labels = [["Col. $i" for i in 1:3], ["$i" for i in 1:3]],
37+
column_labels = [["Col. $i" for i in 1:4], ["$i" for i in 1:4]],
3738
footnotes = [(:column_label, 1, 2) => "Footnote in column label", (:data, 2, 2) => "Footnote in data"],
3839
merge_column_label_cells = [MergeCells(1, 2, 2, "Merged Column", :c)],
3940
row_group_labels = [2 => "Row Group"],
@@ -54,15 +55,16 @@ Source Notes
5455
5556
## Table Subtitle
5657
57-
| **Rows** | **Col. 1**<br>`1` | **Merged Column[^1]**<br>`2` | ─ |
58-
|--:|--:|--:|--:|
59-
| **Row 1** | (1, 1) | (1, 2) | (1, 3) |
60-
| **Row Group** | ─ | ─ | ─ |
61-
| **Row 2** | (2, 1) | (2, 2)[^2] | (2, 3) |
62-
| **Row 3** | (3, 1) | (3, 2) | (3, 3) |
63-
| ─ | ─ | ─ | ─ |
64-
| **Summary 1** | 10 | 20 | 30 |
65-
| **Summary 2** | 20 | 40 | 60 |
58+
| **Rows** | **Col. 1**<br>`1` | **Merged Column[^1]**<br>`2` | ─ | **Col. 4**<br>`4` |
59+
|--:|--:|--:|--:|--:|
60+
| **Row 1** | (1, 1) | (1, 2) | (1, 3) | (1, 4) |
61+
| **Row Group** | ─ | ─ | ─ | ─ |
62+
| **Row 2** | (2, 1) | (2, 2)[^2] | (2, 3) | (2, 4) |
63+
| **Row 3** | (3, 1) | (3, 2) | (3, 3) | (3, 4) |
64+
| **Row 4** | (4, 1) | (4, 2) | (4, 3) | (4, 4) |
65+
| ─ | ─ | ─ | ─ | ─ |
66+
| **Summary 1** | 10 | 20 | 30 | 40 |
67+
| **Summary 2** | 20 | 40 | 60 | 80 |
6668
6769
[^1]: Footnote in column label
6870
[^2]: Footnote in data
@@ -74,7 +76,7 @@ Source Notes
7476
String,
7577
matrix;
7678
backend = :markdown,
77-
column_labels = [["Col. $i" for i in 1:3], ["$i" for i in 1:3]],
79+
column_labels = [["Col. $i" for i in 1:4], ["$i" for i in 1:4]],
7880
footnotes = [(:column_label, 1, 2) => "Footnote in column label", (:data, 2, 2) => "Footnote in data"],
7981
merge_column_label_cells = [MergeCells(1, 2, 2, "Merged Column", :c)],
8082
row_group_labels = [2 => "Row Group"],
@@ -107,7 +109,7 @@ Source Notes
107109
| | **Summary 1** | 10 | 20 | ⋯ |
108110
| | **Summary 2** | 20 | 40 | ⋯ |
109111
110-
*1 column and 1 row omitted*
112+
*2 columns and 2 rows omitted*
111113
112114
[^1]: Footnote in column label
113115
[^2]: Footnote in data
@@ -147,12 +149,12 @@ Source Notes
147149
|--:|--:|--:|--:|---|
148150
| 1 | **Row 1** | (1, 1) | (1, 2) | ⋯ |
149151
| ⋮ | ⋮ | ⋮ | ⋮ | ⋱ |
150-
| 3 | **Row 3** | (3, 1) | (3, 2) | ⋯ |
152+
| 4 | **Row 4** | (4, 1) | (4, 2) | ⋯ |
151153
| ─ | ─ | ─ | ─ | ─ |
152154
| | **Summary 1** | 10 | 20 | ⋯ |
153155
| | **Summary 2** | 20 | 40 | ⋯ |
154156
155-
*1 column and 1 row omitted*
157+
*2 columns and 2 rows omitted*
156158
157159
[^1]: Footnote in column label
158160
[^2]: Footnote in data

test/backends/markdown/full.jl

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,24 @@
55
############################################################################################
66

77
@testset "All Available Fields" verbose = true begin
8-
matrix = [(i, j) for i in 1:3, j in 1:3]
8+
matrix = [(i, j) for i in 1:4, j in 1:4]
99

1010
@testset "Without Cropping" begin
1111
expected = """
1212
# Table Title
1313
1414
## Table Subtitle
1515
16-
| **Row** | **Rows** | **Col. 1**<br>`1` | **Merged Column[^1]**<br>`2` | ─────── |
17-
|--------------:|--------------:|------------------:|-----------------------------:|--------:|
18-
| 1 | **Row 1** | (1, 1) | (1, 2) | (1, 3) |
19-
| **Row Group** | ───────────── | ───────────────── | ──────────────────────────── | ─────── |
20-
| 2 | **Row 2** | (2, 1) | (2, 2)[^2] | (2, 3) |
21-
| 3 | **Row 3** | (3, 1) | (3, 2) | (3, 3) |
22-
| ───────────── | ───────────── | ───────────────── | ──────────────────────────── | ─────── |
23-
| | **Summary 1** | 10 | 20 | 30 |
24-
| | **Summary 2** | 20 | 40 | 60 |
16+
| **Row** | **Rows** | **Col. 1**<br>`1` | **Merged Column[^1]**<br>`2` | ─────── | **Col. 4**<br>`4` |
17+
|--------------:|--------------:|------------------:|-----------------------------:|--------:|------------------:|
18+
| 1 | **Row 1** | (1, 1) | (1, 2) | (1, 3) | (1, 4) |
19+
| **Row Group** | ───────────── | ───────────────── | ──────────────────────────── | ─────── | ───────────────── |
20+
| 2 | **Row 2** | (2, 1) | (2, 2)[^2] | (2, 3) | (2, 4) |
21+
| 3 | **Row 3** | (3, 1) | (3, 2) | (3, 3) | (3, 4) |
22+
| 4 | **Row 4** | (4, 1) | (4, 2) | (4, 3) | (4, 4) |
23+
| ───────────── | ───────────── | ───────────────── | ──────────────────────────── | ─────── | ───────────────── |
24+
| | **Summary 1** | 10 | 20 | 30 | 40 |
25+
| | **Summary 2** | 20 | 40 | 60 | 80 |
2526
2627
[^1]: Footnote in column label
2728
[^2]: Footnote in data
@@ -33,7 +34,7 @@ Source Notes
3334
String,
3435
matrix;
3536
backend = :markdown,
36-
column_labels = [["Col. $i" for i in 1:3], ["$i" for i in 1:3]],
37+
column_labels = [["Col. $i" for i in 1:4], ["$i" for i in 1:4]],
3738
footnotes = [(:column_label, 1, 2) => "Footnote in column label", (:data, 2, 2) => "Footnote in data"],
3839
merge_column_label_cells = [MergeCells(1, 2, 2, "Merged Column", :c)],
3940
row_group_labels = [2 => "Row Group"],
@@ -53,15 +54,16 @@ Source Notes
5354
5455
## Table Subtitle
5556
56-
| **Rows** | **Col. 1**<br>`1` | **Merged Column[^1]**<br>`2` | ─────── |
57-
|--------------:|------------------:|-----------------------------:|--------:|
58-
| **Row 1** | (1, 1) | (1, 2) | (1, 3) |
59-
| **Row Group** | ───────────────── | ──────────────────────────── | ─────── |
60-
| **Row 2** | (2, 1) | (2, 2)[^2] | (2, 3) |
61-
| **Row 3** | (3, 1) | (3, 2) | (3, 3) |
62-
| ───────────── | ───────────────── | ──────────────────────────── | ─────── |
63-
| **Summary 1** | 10 | 20 | 30 |
64-
| **Summary 2** | 20 | 40 | 60 |
57+
| **Rows** | **Col. 1**<br>`1` | **Merged Column[^1]**<br>`2` | ─────── | **Col. 4**<br>`4` |
58+
|--------------:|------------------:|-----------------------------:|--------:|------------------:|
59+
| **Row 1** | (1, 1) | (1, 2) | (1, 3) | (1, 4) |
60+
| **Row Group** | ───────────────── | ──────────────────────────── | ─────── | ───────────────── |
61+
| **Row 2** | (2, 1) | (2, 2)[^2] | (2, 3) | (2, 4) |
62+
| **Row 3** | (3, 1) | (3, 2) | (3, 3) | (3, 4) |
63+
| **Row 4** | (4, 1) | (4, 2) | (4, 3) | (4, 4) |
64+
| ───────────── | ───────────────── | ──────────────────────────── | ─────── | ───────────────── |
65+
| **Summary 1** | 10 | 20 | 30 | 40 |
66+
| **Summary 2** | 20 | 40 | 60 | 80 |
6567
6668
[^1]: Footnote in column label
6769
[^2]: Footnote in data
@@ -73,7 +75,7 @@ Source Notes
7375
String,
7476
matrix;
7577
backend = :markdown,
76-
column_labels = [["Col. $i" for i in 1:3], ["$i" for i in 1:3]],
78+
column_labels = [["Col. $i" for i in 1:4], ["$i" for i in 1:4]],
7779
footnotes = [(:column_label, 1, 2) => "Footnote in column label", (:data, 2, 2) => "Footnote in data"],
7880
merge_column_label_cells = [MergeCells(1, 2, 2, "Merged Column", :c)],
7981
row_group_labels = [2 => "Row Group"],
@@ -105,7 +107,7 @@ Source Notes
105107
| | **Summary 1** | 10 | 20 | ⋯ |
106108
| | **Summary 2** | 20 | 40 | ⋯ |
107109
108-
*1 column and 1 row omitted*
110+
*2 columns and 2 rows omitted*
109111
110112
[^1]: Footnote in column label
111113
[^2]: Footnote in data
@@ -144,12 +146,12 @@ Source Notes
144146
|--------------:|--------------:|-----------:|----------------------:|---|
145147
| 1 | **Row 1** | (1, 1) | (1, 2) | ⋯ |
146148
| ⋮ | ⋮ | ⋮ | ⋮ | ⋱ |
147-
| 3 | **Row 3** | (3, 1) | (3, 2) | ⋯ |
149+
| 4 | **Row 4** | (4, 1) | (4, 2) | ⋯ |
148150
| ───────────── | ───────────── | ────────── | ───────────────────── | ─ |
149151
| | **Summary 1** | 10 | 20 | ⋯ |
150152
| | **Summary 2** | 20 | 40 | ⋯ |
151153
152-
*1 column and 1 row omitted*
154+
*2 columns and 2 rows omitted*
153155
154156
[^1]: Footnote in column label
155157
[^2]: Footnote in data

0 commit comments

Comments
 (0)