Skip to content

Commit acfddca

Browse files
committed
regression test
1 parent a1af643 commit acfddca

File tree

4 files changed

+70
-2
lines changed

4 files changed

+70
-2
lines changed

tests/docs/convert/issue-12440.qmd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
format: typst
3+
---
4+
5+
# This is what happens when I don't set the title.
6+
7+
## This is a level 2 heading
8+
9+
This is some paragraph text.
10+
11+
```{python}
12+
# This is an executable Python code block.
13+
print("This is the output of an executable Python code block.")
14+
```
15+
16+
## This is another level 2 heading
17+
18+
This is some more paragraph text.

tests/smoke/convert/convert-issue-12042.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* convert-backticks.test.ts
2+
* convert-issue-12042.test.ts
33
*
44
* Copyright (C) 2020-2024 Posit Software, PBC
55
*
@@ -12,7 +12,6 @@ import {
1212
import { assert } from "testing/asserts";
1313

1414
(() => {
15-
const input = "docs/convert/backticks.ipynb";
1615
testQuartoCmd(
1716
"convert",
1817
["docs/convert/issue-12042.ipynb"],
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* docs/convert/issue-12440.test.ts
3+
*
4+
* Copyright (C) 2025 Posit Software, PBC
5+
*
6+
*/
7+
import { existsSync } from "../../../src/deno_ral/fs.ts";
8+
import { quarto } from "../../../src/quarto.ts";
9+
import {
10+
ExecuteOutput,
11+
testQuartoCmd,
12+
removeFilesTeardown,
13+
} from "../../test.ts";
14+
import { assert } from "testing/asserts";
15+
16+
(() => {
17+
const input = "docs/convert/issue-12440.qmd";
18+
testQuartoCmd(
19+
"convert",
20+
["docs/convert/issue-12440.qmd"],
21+
[
22+
{
23+
name: "convert-mixed-yaml-markdown-cell",
24+
verify: async (outputs: ExecuteOutput[]) => {
25+
await quarto([
26+
"convert",
27+
"docs/convert/issue-12440.ipynb",
28+
"--output",
29+
"docs/convert/issue-12440-out.qmd",
30+
]);
31+
const txt = Deno.readTextFileSync("docs/convert/issue-12440-out.qmd");
32+
assert(txt.includes("title: This is what happens when I don't set the title"), "Markdown text not found in output");
33+
}
34+
}
35+
],
36+
removeFilesTeardown([
37+
"docs/convert/issue-12440-out.qmd",
38+
"docs/convert/issue-12440.ipynb"
39+
]),
40+
);
41+
})();

tests/test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,3 +336,13 @@ function readExecuteOutput(log: string) {
336336
return JSON.parse(line) as ExecuteOutput;
337337
});
338338
}
339+
340+
export const removeFilesTeardown = (fileList: string[]) => {
341+
return {
342+
teardown: async () => {
343+
for (const file of fileList) {
344+
safeRemoveSync(file);
345+
}
346+
}
347+
};
348+
}

0 commit comments

Comments
 (0)