Skip to content

Commit cc58805

Browse files
committed
Add tests for #7318
#7318 was fixed by #8430 but with no test. This is adding tests that fails without #8430 fix. This way we won't regress in the future.
1 parent 484baab commit cc58805

File tree

6 files changed

+49
-0
lines changed

6 files changed

+49
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.quarto/
2+
**/*.quarto_ipynb
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
project:
2+
title: "Project"
3+
type: website
4+
format:
5+
html:
6+
template-partials:
7+
- metadata.html
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "Document 1"
3+
_quarto:
4+
tests:
5+
html:
6+
ensureFileRegexMatches:
7+
- ['<title>This text will be overwritten.</title>']
8+
---
9+
10+
This is sample document 1.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: "Document 2"
3+
format:
4+
html:
5+
template-partials:
6+
- metadata.html
7+
_quarto:
8+
tests:
9+
html:
10+
ensureFileRegexMatches:
11+
- ['<title>This text will be overwritten.</title>']
12+
---
13+
14+
This is sample document 2.
15+
16+
The `format` metadata is redundant with that in `_quarto.yml`,
17+
but it's here to show that if you remove those options from `_quarto.yml`
18+
but leave them here, the bug will remain the same.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
_quarto:
3+
tests:
4+
html:
5+
ensureFileRegexMatches:
6+
- ['<title>This text will be overwritten.</title>']
7+
---
8+
9+
This is sample document 3, and this one actually works correctly!
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<title>This text will be overwritten.</title>
2+
<!-- I'm not actually trying to have two titles; this just shows the issue more clearly. -->
3+
<!-- Also, these comments show that the rest of this file's contents will be copied over faithfully. -->

0 commit comments

Comments
 (0)