Skip to content

Commit f78207f

Browse files
committed
add verify step to the tests
- Skip test that are not relevant due to other failures - Add more verify steps to really check more than just noErrors
1 parent c2bef9d commit f78207f

5 files changed

Lines changed: 127 additions & 5 deletions

File tree

‎tests/docs/smoke-all/2023/10/18/7267.qmd‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
title: "Test table numbering"
33
format: pdf
4+
_quarto:
5+
tests:
6+
run:
7+
skip: |
8+
This test is wrong because of https://github.com/quarto-dev/quarto-cli/issues/13862.
9+
TODO: to fix.
410
# TODO: we should have _quarto: tests: pdf:
511
# but that doesn't exist yet.
612
---
@@ -35,3 +41,27 @@ knitr::kable(df)
3541

3642
See @tbl-table1 and @tbl-table2.
3743

44+
# Table 3
45+
46+
::: {#tbl-table3}
47+
48+
::: {}
49+
50+
51+
| Column 1 | Column 2 | Column 3 |
52+
|----------|----------|----------|
53+
| Value 1 | Value 2 | Value 3 |
54+
| Value 4 | Value 5 | Value 6 |
55+
| Value 7 | Value 8 | Value 9 |
56+
57+
| Column 1 | Column 2 | Column 3 |
58+
|----------|----------|----------|
59+
| Value 1 | Value 2 | Value 3 |
60+
| Value 4 | Value 5 | Value 6 |
61+
| Value 7 | Value 8 | Value 9 |
62+
63+
:::
64+
65+
A caption
66+
67+
:::

‎tests/docs/smoke-all/2023/10/24/7334.qmd‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,33 @@
22
title: "table in a div"
33
format:
44
html: default
5-
pdf: default
5+
pdf:
6+
keep-tex: true
7+
_quarto:
8+
tests:
9+
html:
10+
ensureHtmlElements:
11+
-
12+
# Verify callout-tip div exists
13+
- 'div.callout.callout-tip'
14+
# Verify table with id inside callout
15+
- 'div.callout-tip #tbl-table1'
16+
# Verify figcaption exists
17+
- '#tbl-table1 figcaption'
18+
# Verify cross-reference link
19+
- 'a.quarto-xref[href="#tbl-table1"]'
20+
pdf:
21+
ensureLatexFileRegexMatches:
22+
-
23+
# Verify tcolorbox for callout-tip exists
24+
- '\\begin\{tcolorbox\}\[.*colframe=quarto-callout-tip-color-frame'
25+
# Verify longtable with caption and label inside tcolorbox
26+
- '\\begin\{tcolorbox\}[\s\S]*\\begin\{longtable\}[\s\S]*\\caption\{\\label\{tbl-table1\}'
27+
# Verify tcolorbox ends after longtable
28+
- '\\end\{longtable\}[\s\S]*\\end\{tcolorbox\}'
29+
# Verify cross-reference to table works
30+
- 'Table~\\ref\{tbl-table1\}'
31+
- []
632
---
733
Table in a div
834

@@ -16,4 +42,6 @@ table <- tribble(~a, ~b, ~c,
1642
"others", 2, "Long text")
1743
knitr::kable(table)
1844
```
19-
:::
45+
:::
46+
47+
See @tbl-table1 in the callout above

‎tests/docs/smoke-all/2023/11/02/7262.qmd‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
---
22
format:
33
pdf: default
4+
keep-tex: true
5+
_quarto:
6+
tests:
7+
pdf:
8+
ensureLatexFileRegexMatches:
9+
-
10+
# Verify outer figure environment wraps the layout
11+
- '\\begin\{figure\}[\s\S]*\\begin\{minipage\}'
12+
# Verify two minipages with equal width
13+
- '\\begin\{minipage\}\{0\.50\\linewidth\}'
14+
# Verify figure[H] inside first minipage with caption and label
15+
- '\\begin\{minipage\}[\s\S]*\\begin\{figure\}\[H\][\s\S]*\\caption\{\\label\{fig-example\}Figure caption\}'
16+
# Verify longtable (NOT wrapped in table environment) inside second minipage
17+
- '\\begin\{minipage\}\{0\.50\\linewidth\}[\s\S]*\\begin\{longtable\}'
18+
# Verify table caption with label
19+
- '\\caption\{\\label\{tbl-example\}Table caption\}'
20+
# Verify minipage ends before outer figure ends
21+
- '\\end\{minipage\}%[\s\S]*\\end\{figure\}%'
22+
# Verify cross-references work
23+
- 'Figure~\\ref\{fig-example\}'
24+
- 'Table~\\ref\{tbl-example\}'
25+
-
26+
# Verify NO table environment wrapper around longtable
27+
- '\\begin\{table\}[\s\S]*\\begin\{longtable\}'
428
execute:
529
echo: false
630
---
@@ -19,4 +43,6 @@ plot(cars)
1943
knitr::kable(head(cars))
2044
```
2145

22-
:::
46+
:::
47+
48+
See @fig-example and @tbl-example

‎tests/docs/smoke-all/2023/11/21/7655.qmd‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
---
22
title: "Untitled"
33
format: pdf
4+
keep-tex: true
5+
_quarto:
6+
tests:
7+
pdf:
8+
ensureLatexFileRegexMatches:
9+
-
10+
# Verify longtable with multiline column specifications
11+
- '\\begin\{longtable\}\[\]\{@\{\}[\s\S]*>\{[^}]+\}p\{[^}]+\}[\s\S]*@\{\}\}'
12+
# Verify caption with label
13+
- '\\caption\{\\label\{tbl-t-quantile\}The Student.*Distribution\}'
14+
# Verify table structure elements
15+
- '\\toprule\\noalign\{\}'
16+
- '\\midrule\\noalign\{\}'
17+
- '\\endhead'
18+
- '\\bottomrule\\noalign\{\}'
19+
- '\\endlastfoot'
20+
# Verify minipage column headers
21+
- '\\begin\{minipage\}\[b\]\{\\linewidth\}\\raggedleft[\s\S]*0\.75[\s\S]*\\end\{minipage\}'
22+
# Verify document ends properly (no compilation error)
23+
- '\\end\{document\}'
24+
- []
425
---
526

627
```{r}

‎tests/docs/smoke-all/article-layout/tables/compute-table-margin.qmd‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
---
2-
format:
2+
format:
33
pdf:
44
geometry:
55
- showframe
6+
keep-tex: true
7+
_quarto:
8+
tests:
9+
pdf:
10+
ensureLatexFileRegexMatches:
11+
-
12+
# Verify margintable environment wraps the table
13+
- '\\begin\{margintable\}'
14+
# Verify longtable with caption and label inside margintable
15+
- '\\begin\{margintable\}[\s\S]*\\begin\{longtable\}[\s\S]*\\caption\{\\label\{tbl-cars\}Cars\}'
16+
# Verify margintable ends after longtable
17+
- '\\end\{longtable\}[\s\S]*\\end\{margintable\}%'
18+
# Verify cross-reference works
19+
- 'Table~\\ref\{tbl-cars\}'
20+
- []
621
---
722

823
{{< lipsum 1 >}}
@@ -16,4 +31,6 @@ format:
1631
knitr::kable(head(cars))
1732
```
1833

19-
{{< lipsum 1 >}}
34+
{{< lipsum 1 >}}
35+
36+
See @tbl-cars

0 commit comments

Comments
 (0)